r/javascript • • Jun 13 '16

A new Angular 1.x ES2015 styleguide, the path to Angular 2

https://toddmotto.com/rewriting-angular-styleguide-angular-2
3 Upvotes

2 comments sorted by

5

u/ishmal Jun 13 '16

Don't agree with the directory layout. The high-level breakdown should be by the individual app, not the module types. Each app should have its own directory.

Instead of app/components/{name}/stuff it should be apps/{name}/components/stuff

1

u/prettycode Software Engineer Jun 14 '16 edited Jun 14 '16

I don't understand why $scope.$watch is not needed anymore. If I need to observe and execute an operation upon changes to a property on my (isolate) scope, how can I accomplish this without $watch()?

I wouldn't put this $watchfunctionality in my link function--as Motto suggestions is still permissible--because I only use a directive's link when I want to modify do DOM manipulation or observation.