最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

詳解angular2.x創(chuàng)建項目入門指令

 更新時間:2018年10月11日 13:43:20   作者:wait14  
這篇文章主要介紹了詳解angular2.x創(chuàng)建項目入門指令,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧

很久沒寫過angular2.x ,最近一次也是幾個月之前,為了下次查閱方便,相關(guān)命令記錄下

1.ng --version 檢查下自己angular cli版本

順便看看npm -v node -v

E:\phpStudy\PHPTutorial\WWW>ng --version

  _           _         ____ _   ___
  / \  _ __  __ _ _  _| | __ _ _ __   / ___| |  |_ _|
 / △ \ | '_ \ / _` | | | | |/ _` | '__|  | |  | |  | |
 / ___ \| | | | (_| | |_| | | (_| | |   | |___| |___ | |
/_/  \_\_| |_|\__, |\__,_|_|\__,_|_|    \____|_____|___|
        |___/
  
Angular CLI: 1.7.3
Node: 8.9.3
OS: win32 x64
Angular:
E:\phpStudy\PHPTutorial\WWW>npm -v
5.5.1

E:\phpStudy\PHPTutorial\WWW>node -v
v8.9.3

2.ng new blog-web 創(chuàng)建一個項目

ng new blog-web --skip-install 這里只跳過安裝 如果沒有跳過沒關(guān)系,目錄安裝完下載很慢可以直接終止,再用cnpm安裝

E:\phpStudy\PHPTutorial\WWW>ng new blog-web --skip-install
 create blog-web/e2e/app.e2e-spec.ts (290 bytes)
 create blog-web/e2e/app.po.ts (208 bytes)
 create blog-web/e2e/tsconfig.e2e.json (235 bytes)
 create blog-web/karma.conf.js (923 bytes)
 create blog-web/package.json (1293 bytes)
 create blog-web/protractor.conf.js (722 bytes)
 create blog-web/README.md (1023 bytes)
 create blog-web/tsconfig.json (363 bytes)
 create blog-web/tslint.json (3012 bytes)
 create blog-web/.angular-cli.json (1243 bytes)
 create blog-web/.editorconfig (245 bytes)
 create blog-web/.gitignore (544 bytes)
 create blog-web/src/assets/.gitkeep (0 bytes)
 create blog-web/src/environments/environment.prod.ts (51 bytes)
 create blog-web/src/environments/environment.ts (387 bytes)
 create blog-web/src/favicon.ico (5430 bytes)
 create blog-web/src/index.html (294 bytes)
 create blog-web/src/main.ts (370 bytes)
 create blog-web/src/polyfills.ts (3114 bytes)
 create blog-web/src/styles.css (80 bytes)
 create blog-web/src/test.ts (642 bytes)
 create blog-web/src/tsconfig.app.json (211 bytes)
 create blog-web/src/tsconfig.spec.json (283 bytes)
 create blog-web/src/typings.d.ts (104 bytes)
 create blog-web/src/app/app.module.ts (316 bytes)
 create blog-web/src/app/app.component.html (1141 bytes)
 create blog-web/src/app/app.component.spec.ts (986 bytes)
 create blog-web/src/app/app.component.ts (207 bytes)
 create blog-web/src/app/app.component.css (0 bytes)
Project 'blog-web' successfully created.

3.cnpm install

這里用淘寶鏡像源,所以上一步只新建目錄相關(guān)文件,國內(nèi)cnpm會快很多,不過后期ng build時候需要注意點

切換進(jìn)項目目錄

E:\phpStudy\PHPTutorial\WWW>cd blog-web

cnpm install

E:\phpStudy\PHPTutorial\WWW\blog-web>cnpm install

4.ng serve 運行

這里的 -open就是自動打開網(wǎng)頁了 默認(rèn)的端口是4200如果端口被占用 可以使用 ng serve --port 4201

E:\phpStudy\PHPTutorial\WWW\blog-web>ng serve -open
** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
 11% building modules 10/10 modules 0 activewebpack: wait until bundle finished: /
Date: 2018-10-11T05:15:14.052Z
Hash: fc83a109759056196c47
Time: 8328ms
chunk {inline} inline.bundle.js (inline) 3.85 kB [entry] [rendered]
chunk {main} main.bundle.js (main) 18.3 kB [initial] [rendered]
chunk {polyfills} polyfills.bundle.js (polyfills) 575 kB [initial] [rendered]
chunk {styles} styles.bundle.js (styles) 42.5 kB [initial] [rendered]
chunk {vendor} vendor.bundle.js (vendor) 7.45 MB [initial] [rendered]

webpack: Compiled successfully.

最后頁面如下


這里面很多指令沒寫,只是當(dāng)做自己再來操作一次,下一篇轉(zhuǎn)載一份ng指令列表 很全

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • Angular環(huán)境搭建及簡單體驗小結(jié)

    Angular環(huán)境搭建及簡單體驗小結(jié)

    Angular基于TypeScript和react、vue相比 Angular更適合中大型企業(yè)級項目,本文通過實例代碼給大家分享Angular環(huán)境搭建及簡單體驗,感興趣的朋友跟隨小編一起學(xué)習(xí)吧
    2021-05-05
  • 對Angular中單向數(shù)據(jù)流的深入理解

    對Angular中單向數(shù)據(jù)流的深入理解

    這篇文章主要給大家介紹了關(guān)于對Angular中單向數(shù)據(jù)流的深入理解,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧。
    2018-03-03
  • 不能不知道的10個angularjs英文學(xué)習(xí)網(wǎng)站

    不能不知道的10個angularjs英文學(xué)習(xí)網(wǎng)站

    這篇文章主要為大家分享了10個大家不能不知道的angularjs英文網(wǎng)站,供大家學(xué)習(xí),感興趣的小伙伴們可以參考一下
    2016-03-03
  • angular中的post請求處理示例詳解

    angular中的post請求處理示例詳解

    這篇文章主要給大家介紹了關(guān)于angular中post請求處理的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者使用angular具有一定的參考學(xué)習(xí)價值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧
    2020-06-06
  • 深入淺析AngularJs模版與v-bind

    深入淺析AngularJs模版與v-bind

    v-bind與{{}}都可以對數(shù)據(jù)進(jìn)行綁定,接下來通過本文給大家介紹AngularJs模版與v-bind的相關(guān)知識,感興趣的朋友一起看看吧
    2018-07-07
  • 詳解Angular Karma測試的持續(xù)集成實踐

    詳解Angular Karma測試的持續(xù)集成實踐

    這篇文章主要介紹了詳解Angular Karma測試的持續(xù)集成實踐,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-11-11
  • angularjs 的數(shù)據(jù)綁定實現(xiàn)原理

    angularjs 的數(shù)據(jù)綁定實現(xiàn)原理

    本篇文章主要介紹了angularjs 的數(shù)據(jù)綁定實現(xiàn)原理,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2018-07-07
  • Angular @HostBinding()和@HostListener()用法

    Angular @HostBinding()和@HostListener()用法

    本篇文章主要介紹了Angular @HostBinding()和@HostListener()用法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2018-03-03
  • angular8和ngrx8結(jié)合使用的步驟介紹

    angular8和ngrx8結(jié)合使用的步驟介紹

    這篇文章主要給大家介紹了關(guān)于angular8和ngrx8結(jié)合使用的詳細(xì)步驟,文中通過示例代碼介紹的非常詳細(xì),對大家學(xué)習(xí)或者使用angular8具有一定的參考學(xué)習(xí)價值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-12-12
  • AngularJS基于ngInfiniteScroll實現(xiàn)下拉滾動加載的方法

    AngularJS基于ngInfiniteScroll實現(xiàn)下拉滾動加載的方法

    這篇文章主要介紹了AngularJS基于ngInfiniteScroll實現(xiàn)下拉滾動加載的方法,結(jié)合實例形式分析AngularJS下拉滾動插件ngInfiniteScroll的下載、功能、屬性及相關(guān)使用方法,需要的朋友可以參考下
    2016-12-12

最新評論

盘山县| 治多县| 墨玉县| 龙游县| 京山县| 衡阳县| 大姚县| 南川市| 丽江市| 安化县| 平舆县| 郧西县| 肇州县| 新疆| 台湾省| 乌审旗| 宽城| 鹤山市| 绥化市| 庆城县| 台东市| 浠水县| 凉城县| 小金县| 长汀县| 巩留县| 涡阳县| 永平县| 兰西县| 增城市| 巍山| 宁化县| 兰州市| 西峡县| 黔南| 淄博市| 乐东| 乾安县| 衡阳市| 广安市| 合水县|