@cisco-msx/common
TypeScript icon, indicating that this package has built-in type declarations

6.0.25-alpha • Public • Published

@cisco-msx/common

Common components and directives for MSX platform and service packs. Also contains mock testing versions of those components and directives that can be used safely outside of an AngularJS environment.

Usage

import { NgModule } from '@angular/core';
import { MsxCommonModule } from '@cisco-msx/common';

@NgModule({
  imports: [
    MsxCommonModule
  ]
})
export class MyModule {}

For service packs, ensure you have installed and are using @cisco-msx/webpack-externals in your Webpack configuration, and add @cisco-msx/common to your package.json's peerDependencies and devDependencies. This ensures that your package indicates that it depends on @cisco-msx/common to run, but will install the package locally during development for use in your unit tests.

{
  "name": "my-service-pack",
  "peerDependencies": {
    "@cisco-msx/common": "^1.0.0"
  },
  "devDependencies": {
    "@cisco-msx/common": "^1.0.0"
  }
}

Testing

If you are testing your component using Angular's TestBed, import the MsxCommonTestingModule in your testing module instead of MsxCommonModule to have @cisco-msx/common's components and directives mocked.

import {
  async,
  ComponentFixture,
  TestBed
} from '@angular/core/testing';
import { MsxCommonTestingModule } from '@cisco-msx/common/testing';
import { MyComponent } from './my.component';

describe('MyComponent', () => {
  let component: MyComponent;
  let fixture: ComponentFixture<MyComponent>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      imports: [
        MsxCommonTestingModule
      ],
      declarations: [MyComponent]
    });
    fixture = TestBed.createComponent(MyComponent);
    component = fixture.componentInstance;
  }));
});

Readme

Keywords

none

Package Sidebar

Install

npm i @cisco-msx/common

Weekly Downloads

0

Version

6.0.25-alpha

License

MIT

Unpacked Size

1.75 MB

Total Files

597

Last publish

Collaborators

  • caygin
  • eturriff
  • vdhaneku
  • rathsaba
  • jjurkiew
  • hagraham
  • posze
  • nstehr-cisco