michaelbromley / michaelbromley/angular-es6
Get rid of the register helper for directives
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 364
- Forks
- 59
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
I want to thank you for this awesome project. I'm switching to es6 and it's really helpful to have all the examples. :)
I'd like to avoid the register helper and use directly angular functions (directive, factory, controller...).
It works well for the controller, but not so well for the directives (the "final boss" :P).
Do you think it's possible to create a Directive base class which hold a factory method to create child classes (including the compile/link method tricks) ? If so, could you provide an example of such a class ?
So you could do :
class myCustomComponent extends Directive {
constructor(inject1, inject2) {}
customMethod1(){}
}
OR
extends directly the "angular" object to make the switch invisible ?
Thanks again. :D
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the register helper and the directive compile/link behavior described in the issue; compare it with the direct Angular controller approach. Done means the project has a decided, documented directive pattern that avoids the helper and covers the requested child-class or factory behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angularjs, javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100