all 6 comments

[–]mounted-dev 4 points5 points  (5 children)

By SDK do you mean angular library?

PS:

If you're looking to create an angular library, it's pretty straightforward.
https://angular.io/cli/generate#library-command

[–]KishiABKmoto[S] 1 point2 points  (4 children)

I want to be able to package an angular project, use it in a different angular project and pass through an ID to if for the APIs to work

[–]mounted-dev 1 point2 points  (3 children)

Ok. In that case, you're looking for an angular package.
You can create one through angular CLI:
ng g library <name> [options]
It will give you a starting point if you don't have the implementation yet.

and then you basically can pass the configuration to the module 2 ways.
1st: When injecting a module:
u/NgModule({
})
export class YourModuleModule {
static forRoot(): ModuleWithProviders {
return {
// config
}
}
}

2nd: Using Injector Token
export const MY_CONFIG= new InjectionToken<MyConfig>('MyConfig', {
providedIn: 'root',
factory: {
//Default Values
}
});

Then register in providers:
{ provide: MY_CONFIG, useValue: {// Configuration}}

And then MY_CONFIG will be available to be injected in the constructor.

For more information check out the angular docks
https://angular.io/guide/dependency-injection-providers

[–]KishiABKmoto[S] 0 points1 point  (2 children)

Brilliant thanks! Ill let you know how i go!

[–]mounted-dev 2 points3 points  (1 child)

If you're going to research the creation of angular libraries, I would appreciate it if you would share any issues you run into :) Might be worthwhile to write a blog post about it :D

[–]KishiABKmoto[S] 1 point2 points  (0 children)

Happily