Pankaj Parkar
Indian | 30 | Ex MVP | Angular GDE
@pankajparkar
www.pankajparkar.com
@pankajparkar
www.pankajparkar.com
Sr. Technology Consultant, Virtusa
pankajparkar
npm install -g @angular/cli
www.pankajparkar.com
ng new posts-view --prefix=pv
<body>
<my-app></my-app>
</body>
import { Component } from '@angular/core';
@Component({
selector: 'pv-root',
standalone: true,
template: `<h1>Hello, {{name}}</h1>`,
imports: [],
styles: [],
})
export class AppComponent {
name: string = 'World';
}
// main.ts
import {
bootstrapApplication
} from "@angular/platform-browser";
import {
AppComponent
} from "./app/app.component";
bootstrapApplication(AppComponent);
Data Bindings
{{myData}}
Property Binding
[ngStyle]="{color: blue}"
Event Binding
(eventName)="methodCall($event)"
www.pankajparkar.com
@pankajparkar
Loop in JS
const posts = ["BMW", "Volvo", "Mini"];
for (let post of posts) {
console.log('Current Post is '+ post);
}
Using *ngFor directive on template
<ul>
<li *ngFor="let post of posts">
{{ post }}
</li>
</ul>
www.pankajparkar.com
@pankajparkar
JSON Placeholder API (Free opensource)
Base Link - https://jsonplaceholder.typicode.com/
Method | URL |
---|---|
GET | /posts |
GET | /posts/1 |
UPDATE | /posts/1 |
www.pankajparkar.com
@pankajparkar
index.html
<html>
<head>
<link href="style.css" />
<script src="app.bundle.js"></script>
</head>
<body>
<header></header>
<section>
<placeholder></placeholder>
</section>
<footer></footer>
</body>
</html>
URL: #/user/list
URL: #/about
URL: #/user/details/1
<h2>User List</h2>
<div>
...
</div>
<div>
About Content
<div>
<h2>User Details</h2>
<div>
...
</div>
www.pankajparkar.com
www.pankajparkar.com
@pankajparkar
@pankajparkar
www.pankajparkar.com
@pankajparkar
Blogs
http://thoughtram.io/
https://johnpapa.net
https://toddmotto.com
https://teropa.info
https://angular.io
https://netbasal.com/@NetanelBasal
https://medium.com/@maximus.koretskyi
Docs
https://angular.io/docs
https://angular.io/api (For API import check)
Best Practices
Coding guidelines by John Papa https://angular.io/guide/styleguide
Books
https://angular-2-training-book.rangle.io/
https://codecraft.tv/courses/angular/
@pankajparkar
By Pankaj Parkar
Angular Essentials