wm-angular-common-lib v0.0.9
Welcome to WM Library for Angular
Hi! This is the place you find angular components that has been developed across our Walmart applications. Feel free to use the components and also contribute if you feel your component is reusable.
Installation and Usage
Install using npm
Make sure you have npm installed or else
npm i -g npm
In your project folder
npm i --save wm-angular-common-lib
Importing in your module and using
import { WmAngularCommonLibModule} from 'wm-angular-common-lib';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
WmAngularCommonLibModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {}
You can use the components directly in your templates (Eg. app.component.html
for Info Component)
<lib-info-component text="'This is sample info icon component'"></lib-info-component>
Contribution and Publish
This library was generated with Angular CLI version 10.0.14.
Code scaffolding
Run ng generate component component-name --project wm-angular-common-lib
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project wm-angular-common-lib
.
Note: Don't forget to add
--project wm-angular-common-lib
or else it will be added to the default project in yourangular.json
file.
Build
Run ng build wm-angular-common-lib
to build the project. The build artifacts will be stored in the dist/
directory.
Publishing
After building your library with ng build wm-angular-common-lib
, go to the dist folder cd dist/wm-angular-common-lib
and run npm publish
.
Running unit tests
Run ng test wm-angular-common-lib
to execute the unit tests via Karma.