1

I made a extensible parent component in Angular.

@Component({
  selector: '',
  templateUrl: '',
})
export class AbstractPagerComponent {...}

and get compilation error :

"ERROR in Couldn't resolve resource from /this-path-is-ok/abstract-pager/abstract-pager.component.ts " I do not get what that error means because paths are ok and the component imported and added to a module.

3 Answers 3

3

after a few my-head-bangs on the wall and a calls to Cthulhu, I realized that this means that he does not have a URL pattern in the component.

so I resolve it by change templateUrl to template


@Component({
  selector: '',
  template: '',
})
export class AbstractPagerComponent{...}
1
  • You should remove @Component() from abstract class definition
    – pvolyntsev
    Commented Jun 4, 2020 at 4:41
0

I have found a solution related to this, create a new component from angular CLI within the same component folder( where you are getting errors), copy all of the logic, HTML code, and CSS files to this new component, and then delete the old component, now change the path and compile, hope this will help

-1

The problem is that the compiler could not find your templateUrl

As an example, for the following path

abstract-pager/
├── abstract-pager.component.html
└── abstract-pager.component.ts

the component would be

import { Component } from "@angular/core";

@Component({
    selector: 'app-pager',
    templateUrl: './abstract-pager.component.html'
})


export class AbstractPagerComponent{

}

Not the answer you're looking for? Browse other questions tagged or ask your own question.