javascript - Angular directives and server requests -


i'm wondering practice make http request fetch data inside angular directive? directive's behavior dependent on data.

so main complexity before it's compiled (to add special classes elements example).

thanks in advance!

imho directives should consume model, not get, post or manipulate model. make attribute in directive called 'src' or similar allow directive bind controller scope. in controller. have update $scope , therefore directive well.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -