ionepaul / angular-plugin-architecture Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Paul,
Any chance that you could provide a license for this? (BSD, MIT, etc?)
Cheers,
:w
After importing SystemJS properly in main.js , I got the error :
Uncaught ReferenceError: SystemJS is not defined
at Object.../../../../../src/main.ts (main.ts:13)
Could you please help me in resolving the error ?
FYI : I am using Angular4.
I am trying to use DatePipe in the Plugin Component but getting Error, Am I missing somthing here?
constructor(private datePipe: DatePipe) { }
ERROR Error: Uncaught (in promise): Error: StaticInjectorError(AppModule)[PluginAComponent -> DatePipe]:
StaticInjectorError(Platform: core)[PluginAComponent -> DatePipe]:
NullInjectorError: No provider for DatePipe!
Error: StaticInjectorError(AppModule)[PluginAComponent -> DatePipe]:
StaticInjectorError(Platform: core)[PluginAComponent -> DatePipe]:
NullInjectorError: No provider for DatePipe!
Is there a way to inject in a plugin constructor, a class provided by core-app ?
In fact I would like:
Have an abstract class
export declare abstract class IPluginComponent {
abstract methodDeclaredInCoreApp(first: String, last: String): String;
abstract anotherMethod(): any;
}
My plugin component which use the interface
constructor(private srvInterface: IPluginComponent) { }
public onSubmit() {
this.result = this.srvInterface.methodDeclaredInCoreApp(this.first, this.last);
}
And in the coreApp realize the IPluginComponent implementation
export class PluginInterface implements IPluginComponent {
methodDeclaredInCoreApp(first: String, last: String): String {
return first + ' @ ' + last;
}
anotherMethod(): any {
return 42;
}
}
Finally I've make some tries but it fails at runtime on
// compile module
const moduleFactory = await this._compiler.compileModuleAsync<any>(module["PluginAModule"]);
My console error :
Error: Can't resolve all parameters for PluginAComponent: (?).
Think of following case:
I cloned the repo, ran npm install and the npm start. The build failed with:
ERROR in node_modules/rxjs/internal/types.d.ts(81,44): error TS1005: ';' expected.
node_modules/rxjs/internal/types.d.ts(81,74): error TS1005: ';' expected.
node_modules/rxjs/internal/types.d.ts(81,77): error TS1109: Expression expected.
I've created a pull request with the fix (update typescript version from ~2.7.2 to ^2.8.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.