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
  • 13,175
  • 9
  • 69
  • 91
Socrates
  • 8,724
  • 25
  • 66
  • 113

1 Answers1

2

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

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567