2.0.7 • Published 5 years ago

uat-ts-angular-components v2.0.7

Weekly downloads
73
License
-
Repository
-
Last release
5 years ago

TsAngularComponents

This project was generated with Angular CLI version 6.2.3.

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the --prod flag for a production build.

Creating a component

1. ng generate module components/ts-[component-name]
2. ng generate component components/ts-[component-name]
3. add component to exports and custom element injector in the module

```javascript
    @NgModule({
    imports: [
        CommonModule
    ],
    declarations: [TsComponentClassName],
    exports: [TsComponentClassName],
    entryComponents: [TsComponentClassName]
    })
    export class TsModuleName {
    constructor(private injector: Injector) {
        const el = createCustomElement(TsComponentClassName, { injector });
        customElements.define('ts-component-selector', el);
    }
    ngDoBootstrap() { }
};
```
3. add module to 'public_api.ts' 

```javascript
   export * from './src/app/components/ts-[component-name]/ts-component-name.module';
```

Publish to NPM

1. make sure you have logged in with correct Travelsmart npm credentials. Refer to npm docs
2. upadete `version` in package.json
3. run `npm run packagr`
4. run `cd dist`
5. run `npm publish`