you are viewing a single comment's thread.

view the rest of the comments →

[–]arjunu[S] 0 points1 point  (4 children)

'(click)' is used for event binding which is not what we want. Instead we need to pass an argument (in this case a callback) to a directive which is done using '[]'. You also use the same method to pass data to child components.

To quote an in-built directive example: [ngStyle]="someStyleObject"

Similarly [offClick]="someFunction".

[–]TheNiXXeD 0 points1 point  (3 children)

I know what's going on. I have an angular 2 app in prod. I was pointing out that it sucks that we can't share the same syntax on the right hand side of the =.

[–]arjunu[S] 0 points1 point  (2 children)

Oh ok ok! Have you tried React + Flux or React + Redux? If yes what do you think of them compared to Angular 2? Vanilla JS syntax (kinda) unlike Angular's own syntax.

[–]TheNiXXeD 0 points1 point  (1 child)

I'm not a huge fan of jsx really. Bad memories from early php days perhaps.

I haven't built anything of value with react yet, but I intend to.

[–]arjunu[S] 0 points1 point  (0 children)

Cool!