Refer this video (https://www.youtube.com/watch?v=KhzGSHNhnbI)
Install Angular Js in system
Run the following commands
npm install -g @angular/cli
ng new a4app
Intall angular js extension for visual studio (Angular 6 snippets)
ng serve
http://localhost:4200/
Note : angular-cli.json has now been changed to angular.json on angular 6
Go to
- src/app/app.component.html (Clear all the text)
- src/app/app.component.ts (Make as below)
- export class AppComponent {
//title = ‘app’;
}
- export class AppComponent {
- Create folder src/app/components.
ng g component components/user (4 files are created in user folder)
- Also there is line `import { UserComponent } from ‘./components/user/user.component’;` created in src/app/app.module.ts
Actual Lesson Starts Now
- Go to src/app/app.component.html and type `<app-user></app-user>`
- Go to user.component.html and type `<h1>Hello World</h1>`
- In user/user.component.ts write as
export class UserComponent implements OnInit {
name = "John Does";
constructor() { }
ngOnInit() {
}
}
4.Go to user.component.html and type `<h1>Hello {{name}}</h1>`
=======================================================================
===========================
==================
5.
ng g service services/data