Skip to main content

Posts

Showing posts from November, 2018

Angular 6/7 basic commands

To set up a new project in angular Download the angular code:  npm install -g @angular/cli install the project ng new project_name ng serve --open --port 42001 ng generate component home ng generate service hero Add Bootstarp 4 in Angular 7  1- npm install bootstrap --save  2- Add css in angular.json file in styles array key ( "node_modules/bootstrap/dist/css/bootstrap.min.css" )  3- Hit ng serve  Download and run Angular Project in local machie:  git clone https://github.com/angular/quickstart.git quickstart npm install (It will download the required modules according to the package.json) npm start or ng serve Live reload not working when change code,  then use sudo ng serve --port 4203 How to use Subscribe in angular when deal with http client with GET/POST menus : Topmenu [] = []; constructor ( private TopmenuService : TopmenuService ) { } ngOnInit () { this . getHeaderMenus (); } getHeaderMenus (...