0

I am trying to figure out what the difference is between @Component and @View in AngularJS 2.

Within the 2 following examples I can achieve the exact same thing.

Example without @View:

import {Component} from 'angular2/core';
@Component({
  selector: 'di-prototype',
  template: `
              <h1>AngularJS 2 Prototype</h1>
            `
})
export class DiPrototype {
}

Example with @View:

import {Component, View} from 'angular2/core';
@Component({
  selector: 'di-prototype'
})
@View({
  template: `
              <h1>AngularJS 2 Prototype</h1>
            `
})
export class DiPrototype {
}
SnareChops
  • 12,721
  • 9
  • 68
  • 90
Socrates
  • 7,512
  • 19
  • 57
  • 100

1 Answers1

2

@View() is about to be removed https://github.com/angular/angular/pull/7495

Günter Zöchbauer
  • 558,509
  • 191
  • 1,911
  • 1,506