r/angularjs • • Feb 05 '16

Angular 1.5 released!

https://github.com/angular/angular.js/blob/master/CHANGELOG.md?=1.5
96 Upvotes

36 comments sorted by

View all comments

10

u/saladfingers6 Feb 05 '16

Time to refactor those directives! :)

Todd Motto wrote a fine pattern with explanation: https://www.reddit.com/r/angularjs/comments/43l0yv/1x_component_what_would_john_papa_do/czjq5e0

6

u/toddmotto Feb 05 '16

And if you can't upgrade to 1.5 just yet, you can refactor those Directives into Component with my 1.5 matching polyfill: https://github.com/toddmotto/angular-component

2

u/toddmotto Feb 05 '16

The 1.5 stable brought a few tweaks, I've just updated the polyfill with these. Require is now present on the Components wrapped definition Object, and restrict is 'E' as default :)

1

u/sunburned_goose Feb 05 '16

I just spent 15 minutes thinking about why CommonJS was needed for the definition object ;)

1

u/toddmotto Feb 05 '16

Haha, not that kinda require ;)