Getting started with Angular 2 involves a new focus on building out components. John walks through the process of bootstrapping your first component as well as how to include one component inside another.
Nice lesson. But I hope to see how you setup your environment.
Right now, setting up the environment is.... tricky... Definitely something the angular team will be working on improving for sure.
But if you want to start playing around with it, I highly recommend you take a look at this repo: https://github.com/ShMcK/ng2Challenges
Guys is recommendable use 2.0 for prod or is best wait for the 2.1??
Angular2 is nowhere near to be production ready - it's not even a final 2.0.
Keep the production code with 1.x still.
Nice lesson. But I hope to see how you setup your environment.
Seconded. Very informative lesson though, otherwise.
I'm slightly confused; you've imported component
and views
, but are the @ symbols part of es6, or typescript?
I'm slightly confused; you've imported
component
andviews
, but are the @ symbols part of es6, or typescript?
@
is a decorator, and in this case is TypeScript syntax. Decorators with the @
are also an ES7 (2016) proposed feature, but are only available through the use of Babel when coding JavaScript.
Good tutorial! Woupld really appreciate if there are more content/videos of angular2 in ES6 than TypeScript.
Although, I have one question: since you had two @Components and @View, how does angular determine which @View goes with which given @Component?
Like, for 'widget' @Component, @View was just '<div>...' so I am confused on HOW angular2 determines the given @View, @Component and class.
Thanks in advance! :)
Good tutorial! Woupld really appreciate if there are more content/videos of angular2 in ES6 than TypeScript.
We are generally going to recommend that you stick with TypeScript for Angular 2. You don't have to learn much on top of ES6, and TypeScript is wonderful for decorators and dependency injection.
The use cases for developing Angular 2 outside of TypeScript exist, but they would need to be very specific.
Embrace the TS! 😉
Thanks for the feedback! But, personally I would prefer to stick with ES6, not a fan of TypeScript.
However, I am more anxious to know about the question/confusion I asked in my comment above.
@View is deprecated since the beta, just use @Component now.
Thanks! So now to define a component in ng2 you only need @Component and 'class' ?
Yes. https://egghead.io/series/angular-2-fundamentals