如何通过npm

时间:2018-04-04 09:05:03

标签: angular ng-bootstrap

我正在使用ng-bootstrap开发一个角度模块。我想导入并将其用作不使用ng-bootstrap的其他角度应用程序中的共享组件。

当我将其导入到其他应用程序时,ng-bootstrap会破坏其他应用程序的样式。它在我暴露的组件中没有被隔离(我使用ViewEncaplusation.Native)。默认ViewEncapsulation(已模拟)也不起作用。

以下是我如何修饰共享组件:

@Component({
  selector: 'app-testcomponent',
  templateUrl: './test.component.html',
  styleUrls: [
      '../../../node_modules/bootstrap/scss/bootstrap.scss',
      './app.component.scss'
   ],
  encapsulation: ViewEncapsulation.Native
})
export class TestComponent {...}</code>

0 个答案:

没有答案