Angular 2 - 在ES5中未定义ViewEncapsulation.Native

问题描述 投票:2回答:1

我想在纯JS iem ES5中编写的Angular 2代码中使用ViewEncapsulation.Native。但它给出了未定义的。如何在es5中访问它?

angular angular2-template
1个回答
1
投票

您可以尝试以下方法:

var AppComponent = ng.core
    .Component({
      selector: 'my-app',
      template: '<div>Test</div>',
      viewEncapsulation: ng.core.ViewEncapsulation.Native
    })
    .Class({
      constructor: function () {
        (...)
      }
    });
© www.soinside.com 2019 - 2024. All rights reserved.