Skip to content
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

how angular-es6 inheritance should be provided? #4

Open
kis opened this issue Oct 13, 2015 · 1 comment
Open

how angular-es6 inheritance should be provided? #4

kis opened this issue Oct 13, 2015 · 1 comment

Comments

@kis
Copy link

kis commented Oct 13, 2015

Parent-child relationship between controllers, directives.
In es5-angular these relationship are implemented using scope and scope inheritance.
Now we use classes, extends, super methods.

But my problem is when I create directive class and then controller class that uses some data from directive class, controller class will be a child of directive class, but in this case directive class constructor will be called 2 times, so I got an error : Multiple directives [searchBar (module: ontour), searchBar (module: ontour)] asking for template on.

It's a big question, i can't find any examples of it in this boilerplate and articles on web.

@michaelbromley
Copy link
Owner

How are you specifying the relationship? Are you making the controller extend the directive?

How about just having a separate class that does not inherit, and referencing it in the directive constructor via this.controller?

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

No branches or pull requests

2 participants