Make component methods protected to support Component inheritance
See original GitHub issueType of issue: (check with “[x]”)
- [X] New feature request
- [ ] Bug
- [ ] Support request
New feature request:
In version 2.3 Angular added component inheritance. I wondered whether it would be possible to the component methods protected (instead of private) where suitable, allowing us to extend the components to more easily customise behaviour.
For example, the UploadButtonComponent
does much of what I need it do, but I would like to slightly change the logic around when to upload the file. With the current implementation, I would have to create my own button component and use the UploadService
from scratch, and repeat much of the code already found within UploadButtonComponent
. If functions such as uploadFiles
were protected instead of private, I wouldn’t need to do this.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Component Inheritance in Angular - Bits and Pieces
There are some key features that will need to understand when using inheritance in our Angular app. Lifecycle methods are not inherited.
Read more >How to extend / inherit components? - angular - Stack Overflow
When you inherit a Component, all logic inside is equally inherited. It is worth noting that only public members are inherited as private...
Read more >Angular How-to: Simplify Components with TypeScript ...
Create the base component · Inherit child component from base component · Use a class to store the injector · Use this injector...
Read more >Lightning LockerService and Component Inheritance
Each and every method, class, property etc. has to undergo a very range ... Pre-existing orgs that contain custom Lightning components will ...
Read more >Reusing Angular component code by using TypeScript ...
The best solution is to create three components Add, Edit, and View. Inherit the same Add component and create its own template for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@JonnyHeavey I think is a good idea. In this way, we can take advantage of the new inheritance introduced in the Angular version 2.3. I think we will prioritize this refactoring and modify the visibility.
Depends on #1522