Professional Documents
Culture Documents
Umesto konzole operativnog sistema (kod Windows operativnog sistema “cmd.exe”) može se
PowerShell ili ugrađen terminal kod Visual Studio Code (View->Integrated Terminal ili Ctrl+`),
tako da se dobija:
Zatim je potrebno da instalirati Angular CLI (Command Line Interface verzija za Angular, koja
omogućava brže kreiranje projekata, dodavanje fajlova i druge aktivnosti tokom razvoja
softvera, kao što su testiranje, kreiranje konačne verzije i deployment), što se na konzoli
postiže komandom:
npm install -g @angular/cli
U slučaju da je Angular već instaliran, postojeći paketi će biti osveženi, dok neki mogu biti
uklonjeni ili dodati u skladu sa poslednjom verzijom:
U slučaju da komanda nije dostupna, potrebno je dodati putanju u “Path”, slično kao i za
Angular:
C:\Users\NNN\AppData\Roaming\npm\node_modules\typescript\bin
ng serve komanda pokreće server, prati eventualne izmene u fajlovima i automatski ponovo
kreira aplikaciju sa uklјučenim izmenama, dok --open parametar automatski otvara browser
na adresi: http://localhost:4200/, čime se dobija strana kao na slici.
Ovo je novi izgled podrazumevanie Angular aplikacije, a ranije je ta aplikacija izgledala kao na
sledećoj slici. Ova izmena je bila planirana da se uvede od Angular verzije 7, međutim uvedena
je tek nešto kasnije. Ako vam više odgovara stari izgled početne aplikacije, možete sadržaj
odgovarajućeg fajla (app.component.html) zameniti sadržajem datim na:
https://github.com/mjnaderi/stryker-
old/blob/master/e2e/test/angular-project/src/app/app.component.html
Izvorni kod za početnu aplikaciju može se videti u src/app direktorijumu, gde za ovu aplikaciju
fajl app.component.ts predstavlјa glavnu komponentu. Ako u toj komponenti promenimo
vrednost za „title“, ta vrednost će se automatski prikazati u browser-u.
Takođe, u fajlu app.component.css možemo dodati CSS stil za H1 element.
Ovakva Angular aplikacija je pandan “Hello, World!” aplikacijama koja se često daje kao
osnovni primer u pojedinim programskim jezicima.
This folder contains one file for each of your destination environments,
each exporting simple configuration variables to use in your application.
The files are replaced on-the-fly when you build your app. You might use
environments/*
a different API endpoint for development than you do for production or
maybe different analytics tokens. You might even use some mock
services. Either way, the CLI has you covered.
The main HTML page that is served when someone visits your site. Most
of the time you'll never need to edit it. The CLI automatically adds all js
index.html
and css files when building your app so you never need to add any
<script> or <link> tags here manually.
Unit test configuration for the Karma test runner, used when running ng
karma.conf.js
test.
The main entry point for your app. Compiles the application with the JIT
compiler and bootstraps the application's root module (AppModule) to
main.ts run in the browser. You can also use the AOT compiler without changing
any code by appending the--aot flag to the ng build and ng
serve commands.
Your global styles go here. Most of the time you'll want to have local
styles.css styles in your components for easier maintenance, but styles that affect
all of your app need to be in a central place.
This is the main entry point for your unit tests. It has some custom
test.ts configuration that might be unfamiliar, but it's not something you'll need
to edit.
Ako se radi na više projekata, često postoji problem oni zahtevaju različite verzije Node.js-a,
a Node version manager omogućava da u bilo kom trenutku za tekući projekat aktiviramo
tačno određenu verziju Node.js-a. U pomenutom članku dat je opis za Linux i MacOS računare,
kao i Windows Subsistem for Linux (WSL), a za Windows je dostupan NVM for Windows:
https://github.com/coreybutler/nvm-windows