Skip to content

Angular 1.x directive to Angular 1.5 component conversion guide #367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

dgutride
Copy link
Member

@dgutride dgutride commented Dec 8, 2016

Describes how to convert an Angular 1.x style directive to a new 1.5 style component

Copy link
Contributor

@AllenBW AllenBW left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanta just throw this out there as an idea, rather than targeting 1.5, perhaps a target 1.6 is a better idea given that the component inner workings are still fairly fluid.

In 1.6 the the lifecycle hook $onInit becomes the exclusive provider of all models available on the component template. This turns the controller into a bin for functions rather than a 🍜

for more reading: https://toddmotto.com/angular-1-6-is-here

overall though SUPER excited for this change 🌮

<!------------->
<!-- becomes -->
<!------------->
angular.module('patternfly.notification').directive('pfNotificationDrawer', {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be .component rather than .directive?

@dtaylor113
Copy link
Member

Nice @dgutride , LGTM

@dtaylor113
Copy link
Member

Hi @AllenBW, I think @dgutride is still evaluating 1.6. I 'believe' when/if we goto 1.6, we will update this guilde.
Thanks!

  • Dave

@dlabrecq
Copy link
Member

LGTM

@dlabrecq dlabrecq merged commit 831dffd into patternfly:branch-4.0-dev Dec 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants