Narayan Prusty
Narayan Prusty

Reputation: 2581

Angular 2 - ViewEncapsulation.Native is undefined in ES5

I want to use ViewEncapsulation.Native in Angular 2 code written in pure JS i.e.m ES5. But it gives undefined. How to access it in es5?

Upvotes: 2

Views: 133

Answers (1)

Thierry Templier
Thierry Templier

Reputation: 202176

You could try the following:

var AppComponent = ng.core
    .Component({
      selector: 'my-app',
      template: '<div>Test</div>',
      viewEncapsulation: ng.core.ViewEncapsulation.Native
    })
    .Class({
      constructor: function () {
        (...)
      }
    });

Upvotes: 1

Related Questions