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 { } 
4
  • 1
    Duplicate of stackoverflow.com/a/33401775/4933038 (I screwed up the flag, I used a wrong question...) Commented Jan 4, 2016 at 23:05
  • 4
    Possible duplicate of Angular 2.0. Difference @View @Component Commented Jan 5, 2016 at 1:31
  • @EricMartinez Thanks for the link. Commented Jan 5, 2016 at 1:35
  • You're welcome :D. Thanks @MarkRajcok, I totally screwed it up :P Commented Jan 5, 2016 at 1:45

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.