How to compile with extending angular component
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 238
- Avg merge
- 2m
- Merged PRs (30d)
- 1
Description
Hello,
I want to compile custom class with extending an angular component.
For example this is my angular angular component : src/app/shared/components/application/test/test.component.ts
I have a class like this. It extends TestComponent. I want to compile this but it gives Cannot find name 'TestComponent' as normal.
How i can import this Test Component into this?
I want to compile this ts to js and load it dynamiclly to TestComponent to extend angular component's functionality at runtime with custom code.
Code to compile:
compileRequest.CustomCode += "module com.test.dp.application {\n";
compileRequest.CustomCode += "export class CustomApp1 extends TestComponent { \n";
compileRequest.CustomCode += " public modelChanged(newObj) { \n";
compileRequest.CustomCode += " alert('test1');\n";
compileRequest.CustomCode += " } \n";
compileRequest.CustomCode += " } \n";
compileRequest.CustomCode += " } \n";
Thank you!
Contributor guide
Research direction
Begin with src/app/shared/components/application/test/test.component.ts and the generated CustomCode shown in the report; verify how the custom class is expected to resolve TestComponent before attempting compilation. Done means a documented or reproducible path that compiles the TypeScript and loads the resulting class dynamically, or a clear limitation if this is unsupported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- compilers, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100