Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: cannot .replace() a component that has an abstract base class #8201

Open
Eugeny opened this issue Feb 12, 2024 · 0 comments
Open

Bug: cannot .replace() a component that has an abstract base class #8201

Eugeny opened this issue Feb 12, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Eugeny
Copy link

Eugeny commented Feb 12, 2024

ng-mocks is checking the decorators and will fail if there's both @Component and @Injectable present. Instead, it should ignore @Injectable if there's @Component or @Directive present.

@Injectable is required on base component classes to avoid the Class is using Angular features error when inheriting, for example:

@Injectable()
abstract class Base {
	ngOnInit () {} 
}

@Component({...})
class Component extends Base {}
@Eugeny Eugeny added the bug Something isn't working label Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants