- Create a angular project
ng new project
- install dependencies
npm install
- start project
npm start // localhost:4200 Default port
ng serve --port 3200 // localhost:3200 Designation port
Introduce the third party libaraies(ngx-bootstrop)
- install
npm install ngx-bootstrap bootstrap --save
- introduce
// app.module.ts
import { AlertModule } from 'ngx-bootstrap';
import { ButtonsModule } from 'ngx-bootstrap';
...
@NgModule({
imports: [
AlertModule.forRoot(),
ButtonsModule.forRoot()
]
})
- angular-cli.json settings
"styles": [ // css introduce
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
"styles.css",
],
"scripts":[] // js introduce
Less & Sass introduce (Sass) (Less)
- Create a new project with Sass or Less with the following
ng new my-sassy-app --style=sass
ng new my-sassy-app --style=less
- Converting a current app to Sass
tell angular-cli to start process .sass files.
ng set defaults.styleExt sass
the hood at what this command did? Look at the file of angular-cli.json
"defaults": {
"styleExt": "scss",
"component": {
}
}
- You may have to Converting .css files to .sass manually