2016年9月28日 星期三

[Angular2] 建立專案範本

前言

身為一個全端工程師,除了網站前後端外,在專案上開始也有開發App的需求,在過去我們團隊使用Angular來撰寫前端程式,後端採用ASP.NET Web API,而App我們使用Cordova搭配ionic 。但專案進入維護期,有新人也加入了,但因為Angular學習曲線有點太高,導致會不太好上手,且專案一大,因為是使用JavaScript開發,如果對於JavaScript特性不太熟悉,很容易掉入地獄裡面。在今年評估Angular2後,決定狠下心從將Angular1重構成Angular2專案,因為是搭配TypeScript來開發,搭配編輯器的功能,讓有些錯誤可以在編譯時期,且編輯器自動完成功能讓開發起來更加順手,對於TypeScript有種相間恨晚的感覺,應該在Angular1時間就使用TypeScript來撰寫會比較順手。

Angular2學習曲線我認為也不低,複雜在於"開發環境",他將自己定位成平台,所以整合很多的open source技術進來,但就一個團隊新人來講,開發環境並不是首要去了解的,很多事情都定義成腳本,只要會使用就可以。就程式撰寫上,Angular2的學習曲線我覺得大大的降低,且因為官方就訂了很多程式開發標準.建議,讓使用Agnular2開發的人都有一致的開發風格,這也是後來在github看別人專案也能很快看懂的原因。

目前(2016年)也已經進入正式版,這篇文章算是一個開始,我陸續想將開發上所撰寫的功能及採到的地雷,整理成一篇一篇的小筆記,而不免俗的來Hello Word一下,讓之後demo的Sample Code都以此篇的專案範本來撰寫。

建立Angular2專案範本

使用前請安裝Node.js 會一併安裝NPM

可以用指令確認版本

螢幕快照 2016-10-08 下午9.46.40

透過NPM安裝 Angular-cli

npm install –g angular-cli

ng –v 確認版本

螢幕快照 2016-10-08 下午9.48.16

ng new mydemo 建立專案
cd mydemo 進入資料夾
ng serve 啟動本機localserver

用瀏覽器開啟http://localhost:4200/

如果有出現app work!畫面代表成功。

--

本篇利用Angular-cli很簡單的建立範本讓之後的文章做參考,

建議可以參考 Angular2官網手把手接學  照步驟做完應該就會開發了XD

也可以參考保哥的文章,整理很多Angular2觀念及延伸學習資源

文章索引連結(陸續新增)

Angular 2

[Angular2] 在每個Request加入自訂的Header資訊

[Angular2] 在angular-cli專案加入第三方套件-以jQuery.Bootstrap為例

[Angular2] 在專案加入多國語系

 

Ionic 2

15 則留言:

  1. Thanks a lot for sharing
    Having good health is what most people out there wants but can not achieve. some people takes buy ibogaine online AND buy weed online to get it.

    回覆刪除
  2. medical care is what many people lack in the interior areas of the world. people face a lot of health issues everyday without solution. buy psychedelics online, Buy weed online, Buy alprazolam online

    回覆刪除
  3. Thanks for sharing What an interesting site you have i really take a good look buy cocaine online and you can also take a good look at our blog too for more information buy crack cocaine online we also recommend you to take a good look at this site too they have good content buy mdma crystals online more of the site still want you to take a closer look too as they have really good content buy crystal meth online thanks for using your time to check on the link .order cocaine online

    回覆刪除
  4. https://k2incenseonlineheadshop.com/
    info@k2incenseonlineheadshop.com
    Buy liquid incense cheap
    Buy liquid incense cheap For Sale At The Best Incense Online Shop
    K2 Spice Spray | Liquid K2 | Liquid Spice | K2 Spray for sale

    回覆刪除
  5. https://syntheticworldwide.com/
    sales@syntheticworldwide.com

    Buy cheap liquid herbal incense at your best online shop

    回覆刪除
  6. to the medical condition of most patients. many people suffering from cancer, chronic pain, anxiety and man more have overcome their illment with cannabis. you can order weed from our store




    回覆刪除
  7. marijuana has been a stepping stone to the medical condition of most patients.
    many people suffering from cancer, chronic pain, anxiety, and many more have overcome their aillment with cannabis.
    you can order weed from our store.medical condition

    回覆刪除



  8. Our online store is one of the best in the supply of rare and high-grade (Mushrooms, Edibles. Psychedelics, and more)with absolute purity. All our products are tested to guarantee potency after production, during distribution and even storage. We ship globally in discreet and undetectable packaging using our network of trusted partners.
    psilosybin mushroom 2022, trusted magic mushroom site 2022,
    cheap liquid lsd, order cheap psychedelic mushroom,
    cheap magic mushroom, super quality shrooms,
    most potent psilocybin mushroom on the market,
    best microdosing mushrooms 2022, Golden teacher mushroom for sale,
    where to buy B+ magic mushroom, buy shrooms online ,
    buy psilocybin mushroom overnight shipping, effective microdosing for ptsd,
    buy mushroom truffles online cash on delivery, buy microdose capsules online 2021,
    magic mushrooms for mental illness for sale,
    buy mushies for anxiety/deppression and ptsd, cheap psilocybin mushroom, shrooms near me,
    where to buy psilocybin mushroom near me, cheap psychedelic mushroom for sale,
    buy caps/buttons cheap, best place to buy magic mushroom,
    buy cheap fungi mushrooms, cheap strong fungus, best quality spores for sale,
    buy mushroom grow kit online, buy fungi shrooms near me, cheapest magic mushrooms online,
    where to buy penis envy online, where to buy mexicanna online, buy microdose capsules online,
    best microdose capsule for sale,
    fungi mushroom for sale, best liquid cultures online, buy spores near me, buy Nirvana mushroom near me,
    buy pajaritos mushrooms near me, psychedelic mushroom near me, buy medicinal mushroom online,
    buy 5-MeO-DMT, buy dmt vape pen online, buy lsd tabs online, buy dmt online, where to buy dmt,
    lsd for sale, buy mushies near me, buy shrooms wholesale price, strong boomers for sale,
    Buy trippy shrooms online, buy penis envy, buy albino A+, buy amazonian cubensis,
    buy psilocybe cubensis, buy blue meanie, buy vietam cubensis, buy z strain shrooms,
    buy boomers cubensis online, buy cubensis buy golden teacher, buy liquid lsd online
    Our quality is the best you can find around and we sell in small/large quantities with guaranteed discreet delivery in good time Shipping




    website...https://megapsilocybin.com/
    call/text..+1(458) 201-6900
    email..sale@megapsilocybin.com

    回覆刪除
  9. Most valuable and fantastic blog I really appreciate your work which you have done about the electricians,many thanks and keep it up. Very useful info. Hope to see more posts soon! I really like to read this post, it shares lots of information to readers.a

    Graphic Design company in USA

    Label Design

    Box Packaging Design

    Packaging Host

    Die Cut Stickers

    Static Cling

    Lahore Smart City Payment Plan

    Hosting Mart

    Lahore Smart City

    回覆刪除
  10. Indeed, companies look for various requirements before they hire an app developer, knowledge of HTML, CSS, etc is a must. Eiliana.com is a global freelancing portal where companies across the world post their project requirements and hire professional freelancers.

    回覆刪除