-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotes.txt
79 lines (51 loc) · 1.94 KB
/
notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Database setup:
mysql -u m3620_m3620 -p iteleskop (pass z......x)
Useful commands:
# Runs Angular live development server that listens on localhost:4200
ng serve --open
# Builds release version in dist/
ng build
# Runs unit-tests
ng test
# Runs end-to-end tests
ng e2e
commands:
npm list - lists all installed modules in this project
npm outdated - lists outdated modules
npm update - upgrades to the latest available versions
# Adding material to a project
npm install --save @angular/material @angular/cdk @angular/animations
# Architecture
Angular is a collection of NgModules. Every Angular app has a root
module, conventionally named AppModule, which provides the booststrap
mechanism that launches the application. See
src/appl/app.module.ts
To add a new component:
$ ng generate component <component name>
This will generate:
CREATE src/app/hero-detail/hero-detail.component.css (0 bytes)
CREATE src/app/hero-detail/hero-detail.component.html (30 bytes)
CREATE src/app/hero-detail/hero-detail.component.spec.ts (657 bytes)
CREATE src/app/hero-detail/hero-detail.component.ts (288 bytes)
.css component styles
.html component template
.ts typescript file with a component class
.spec.ts a test file for <component name>
*.component.ts - component class
import { Component, OnInit, Input } from '@angular/core';
Component - this is a component
OnInit - it has OnInit action
Input - it will take an input
To provide service, you need:
$ ng generate service hero
This will generate a service. Now you need to make sure the
HeroService
---------------
To verify that our application runs correctly, we run:
$ ng serve
If ng serve fails to start, try deleting your node_modules directory
and package-lock.json file and run npm install to recreate a clean
node_modules directory and package-lock.json file.
TODO:
- http://localhost/ is hardcoded in 2 places (login, tasks). It works ok on billabong, but not on megaton
need a way to make that configurable