Hard to say without looking at the code. I assume you've called super() 
somewhere which calls the parent's constructor, sets up the "roleService"?

If you share the code, somebody might help you.

On Friday, September 28, 2018 at 9:22:12 AM UTC+2, Partha Majumdar wrote:
>
> Thanks Sir.
>
> I tried the same.
>
> After inheriting I am getting the following error.
>
>
> ERROR TypeError: this.roleService.getData is not a function
>     at 
> AppRoleListComponent.push../src/app/role/role-list/role-list.component.ts.AppRoleListComponent.ngOnInit
>  
> (role-list.component.ts:41)
>     at checkAndUpdateDirectiveInline (core.js:9250)
>     at checkAndUpdateNodeInline (core.js:10514)
>     at checkAndUpdateNode (core.js:10476)
>     at debugCheckAndUpdateNode (core.js:11109)
>     at debugCheckDirectivesFn (core.js:11069)
>     at Object.eval [as updateDirectives] (AppRoleComponent.html:9)
>     at Object.debugUpdateDirectives [as updateDirectives] (core.js:11061)
>     at checkAndUpdateView (core.js:10458)
>     at callViewAction (core.js:10699)
>
>
> How can I resolve this?
>
> On searching the internet, I figure that it is some known bug in Angular.
>
> Regards,
> Partha
>
> On Friday, 28 September 2018 12:42:09 UTC+5:30, Zlatko Đurić wrote:
>>
>> In short, yes, you can extend a TypeScript class or implement an 
>> interface, and you only need to import the class in the component itself. 
>> You can even import a class from a library in your Node modules folder.
>> But there are two things to be aware of:
>> - you have to make sure that the dependencies are satisfied. E.g. If the 
>> abstract class takes a UserService as a constructor parameter, your module 
>> (or ultimately your root module) need to provide that service. Sounds 
>> obvious, but worth pointing out.
>> - the bigger potential issue is that you're extending the TypeScript 
>> class, not an Angular-specific component. That means that you have to apply 
>> angular decorators to the new class (Injectable, Component etc), anything 
>> on the parent class is simply not there.
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to