1egoman / funnies

:stuck_out_tongue_winking_eye: Make users laugh when your app loads.
https://1egoman.github.io/funnies/
MIT License
178 stars 54 forks source link

Write an angular directive for funnies! #3

Open 1egoman opened 7 years ago

1egoman commented 7 years ago

Funnies has a raw javascript, react, and jquery bindings. I've had many requests for Angular bindings too.

It's been a while since I used Angular, but I'm pretty sure that we'd want to make a directive called funnies, and have it render one of the funny phrases in here (probably in a span with a custom classname so it can be styled). Behind the scenes, you can consume this api to generate a random funny message to display. Bonus points if you can make the phrase change every couple seconds! 😄

Thanks for your help!

kobvel commented 7 years ago

Which version of Angular you wanna take first? AngularJS or Angular 2 ?

1egoman commented 7 years ago

@kobvel I have familiarity myself with Angular 1.x, but I hear Angular 2 is the new hotness. Probably Angular 2? What do you think?

kobvel commented 7 years ago

@1egoman no problem. In case it would be more helpful !

david1983 commented 7 years ago

I've done a component that cycles the funnies in Angular2, I've tried to use the same style of the one you have in the homepage, I've also added some animations. Where do you want me to pull the .ts file ? do you want me to pull only the component or also a small demo (I've got the demo already)? Do you want me to do a small docs on how to install the component and how to use it ?

the usage is similar to the react implementation

<app-funnies [interval]="'4000'" [customMessages]="messages"></app-funnies>

1egoman commented 7 years ago

@david1983 This is really cool!

Go ahead and either add the code directly in the src/ folder or in a src/angular/ subfolder if there's more than one file. Also, if you wouldn't mind, could you add the required gulp configuration to compile and import?

Thanks a lot!

kevinralph commented 7 years ago

@1egoman Any interest in an Angular 1.x directive?

1egoman commented 7 years ago

@kevinralph Sure!