Angular 项目启动


  • 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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值