AngularJS Style Guide
gocardless.com
AngularJS Style Guide
1–10 of 41 posts
Re: AngularJS Style Guide
#2Re: AngularJS Style Guide
#3The actual post title is: "The GoCardless AngularJS Style Guide". I was expecting something about how they needed to do XYZ to make Angular run well rather than how they scale up development .
Re: AngularJS Style Guide
#4Re: AngularJS Style Guide
#5Re: AngularJS Style Guide
#6One thing I'm hesitant about is their advice to use directives instead of ng-controller="MyCtrl". Since controllers really are app specific glue code I rarely find myself wanting to reuse them - what advantages are directives supposed to give here?
Re: AngularJS Style Guide
#7Very helpful. I've unsuccessfully search for a way to do one-time binding before in a data intensive application and never came across the {{::ctrl.foobar}} syntax. One thing I'm hesitant about is their advice to use directives instead of ng-controller="MyCtrl". Since controllers really are app specific glue code I rarely find myself wanting to reuse them - what advantages are directives supposed to give here?
Re: AngularJS Style Guide
#8Todd Motto's angular style guide [1] has been one of the most helpful to me. It's always good to read multiple style guides and cherry-pick what works best for you :) [1]: https://github.com/toddmotto/angularjs-styleguide
Re: AngularJS Style Guide
#9Very helpful. I've unsuccessfully search for a way to do one-time binding before in a data intensive application and never came across the {{::ctrl.foobar}} syntax. One thing I'm hesitant about is their advice to use directives instead of ng-controller="MyCtrl". Since controllers really are app specific glue code I rarely find myself wanting to reuse them - what advantages are directives supposed to give here?
You can also define a controller and have the directive consume it via named reference - here is one example that makes use of this: https://github.com/driftyco/ionic/blob/master/js/angular/dir...
Controllers should be consumed this way, so that they become easier to test. Testing directives can get complicated.
Re: AngularJS Style Guide
#10Very helpful. I've unsuccessfully search for a way to do one-time binding before in a data intensive application and never came across the {{::ctrl.foobar}} syntax. One thing I'm hesitant about is their advice to use directives instead of ng-controller="MyCtrl". Since controllers really are app specific glue code I rarely find myself wanting to reuse them - what advantages are directives supposed to give here?
This makes it easy to work with data that doesn't change, promises, or large amounts of data that rarely changes.
Karl Seamon did a great talk about performance this past January at ng-conf as well, https://www.youtube.com/watch?v=zyYpHIOrk_Y