funnies icon indicating copy to clipboard operation
funnies copied to clipboard

Write an angular directive for funnies!

Open 1egoman opened this issue 8 years ago • 7 comments

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!

1egoman avatar Oct 16 '16 17:10 1egoman

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

kobvel avatar Oct 23 '16 17:10 kobvel

@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?

1egoman avatar Oct 23 '16 17:10 1egoman

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

kobvel avatar Oct 23 '16 17:10 kobvel

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>

david1983 avatar Oct 25 '16 23:10 david1983

@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!

1egoman avatar Oct 26 '16 00:10 1egoman

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

kevinralph avatar Oct 27 '16 01:10 kevinralph

@kevinralph Sure!

1egoman avatar Oct 28 '16 11:10 1egoman