Angular Creating CRUD Apps

1 min. read

Course URL:
https://www.lynda.com/Angular-tutorials/Introduction/616738/659482-4.html

Setup
Install angular CLI
npm install @angular/cli -g

Type ng to make sure it installed.
Start new project
ng new PROJECTNAME –routing

cd into PROJECTNAME
npm install

ng serve –o
User Events
In HTML
<button (click)=”onBtnClicked()”>Test

In code:
onBtnClicked(){
console.log(“button clicked”);
}
Displaying Data
Interpolation

ngFor Directive
*ngFor=”let item for items”

Generate new Component
ng g c COMPONENTNAME

Setting up router
const routes: Routes = [ { path:”about/:name”, component:AboutComponent } ];
Firebase
Create new project
“Add firebase to web app”
Copy config keys

Make database read/write public:
{
“rules”: {
“.read”: “auth != true”,
“.write”: “auth != true”
}
}

Client side,
Copy this
https://cdnjs.cloudflare.com/ajax/libs/foundation/6.4.3/css/foundation-float.css

Paste into index.html

Grab google fonts: