Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make component methods protected to support Component inheritance

See original GitHub issue

Type 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:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

eromanocommented, Jan 20, 2017

@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.

DenysVuikacommented, Feb 10, 2017

Depends on #1522

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found