A simple starter project demonstrating the basic concepts of Angular 2.
- Clone or fork this repository
- Run
npm install - Open the folder as a workspace in VS Code (shortcut: run
code .from the repo folder) - Open src\app\app.component.ts
- When prompted, choose to use the "workspace" version of TypeScript
- You should see an error in the template string:
template: '<div title={{ba}}></div>'
~~ error: 'ba' is not defined
- Place the caret in the attribute template, delete 'ba', and press Ctrl-Space
- You should see the class members:
@Component({
selector: 'app',
template: '<div title={{}}></div>'
foo
bar
})
export class AppComponent {
foo: string;
bar: number;
}
- Select 'foo'
- Press F12 to Go to Definition
- The caret is now on the
foomember of the component class
- Clone or fork this repository
- Make sure you have node.js installed version 5+
- Make sure you have NPM installed version 3+
WINDOWS ONLYrunnpm install -g webpack webpack-dev-server typescriptto install global dependencies- run
npm installto install dependencies - run
npm startto fire up dev server - open browser to
http://localhost:3000 - if you want to use other port, open
package.jsonfile, then change port in--port 3000script