Begin with Angular

用intellij+angular寫(xiě)一個(gè)index.html

  • Greate a static web project by intellij
1.png
  • use ** cd IdeaProjects/test ** go to the project directory which u created
2.png
  • use ** npm init ** to initialize the project. It will creat a ** package.json ** file to record the dependencies of this project. Just press the ** return ** to create a default package.json file.
3.png

now check ur project in Intellij, the package.json is already there.


4.png
  • If u use the git as a VCS, u can use ** vim .gitignore ** to add the ignore file which used to tag the files and directories which u don't want to sync or commit. (usually some config files or libraries)


    5.png

now back to Intellij, if u not plugin the .ignore in ur Intellij u'd better install it (the Intellij will remind u to install .ignore just follow the hint). U can also press ** command + , ** to open the preference then ** -> plugins -> Browse repositories... -> search ".ignore" -> install ** to install the plugin.


6.png
  • then use ** npm install angular ** to add the angular into project


    7.png

now back to intellij the ** angular.js ** is contented in the ** node_modules **


8.png
  • then add a html file to the project and name it as ** index **
    copy following code into the index.html
<html ng-app>
<head>    
  <script src="node_modules/angular/angular.min.js"></script></head>
<body>
  <div>
    <label>NameNameName:</label>    
    <input type="text" ng-model="yourName" placeholder="Enter a name here">    
    <hr>    
    <h1>Hello {{yourName}}!</h1>
  </div>
</body>
</html>
  • then use ** http-server ** to start the http server


    9.png

then open ur Browser and type ** localhost:8080 ** in the url to check ur first angular html.


10.png

Congratulations ! now u can write any code ur learned from angular.js !

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末构捡,一起剝皮案震驚了整個(gè)濱河市液南,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌勾徽,老刑警劉巖滑凉,帶你破解...
    沈念sama閱讀 217,657評(píng)論 6 505
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異喘帚,居然都是意外死亡畅姊,警方通過(guò)查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,889評(píng)論 3 394
  • 文/潘曉璐 我一進(jìn)店門吹由,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)若未,“玉大人,你說(shuō)我怎么就攤上這事倾鲫〈趾希” “怎么了?”我有些...
    開(kāi)封第一講書(shū)人閱讀 164,057評(píng)論 0 354
  • 文/不壞的土叔 我叫張陵乌昔,是天一觀的道長(zhǎng)隙疚。 經(jīng)常有香客問(wèn)我,道長(zhǎng)磕道,這世上最難降的妖魔是什么供屉? 我笑而不...
    開(kāi)封第一講書(shū)人閱讀 58,509評(píng)論 1 293
  • 正文 為了忘掉前任,我火速辦了婚禮溺蕉,結(jié)果婚禮上伶丐,老公的妹妹穿的比我還像新娘。我一直安慰自己疯特,他們只是感情好哗魂,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,562評(píng)論 6 392
  • 文/花漫 我一把揭開(kāi)白布。 她就那樣靜靜地躺著漓雅,像睡著了一般啡彬。 火紅的嫁衣襯著肌膚如雪羹与。 梳的紋絲不亂的頭發(fā)上,一...
    開(kāi)封第一講書(shū)人閱讀 51,443評(píng)論 1 302
  • 那天庶灿,我揣著相機(jī)與錄音纵搁,去河邊找鬼。 笑死往踢,一個(gè)胖子當(dāng)著我的面吹牛腾誉,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播峻呕,決...
    沈念sama閱讀 40,251評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼利职,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來(lái)了瘦癌?” 一聲冷哼從身側(cè)響起猪贪,我...
    開(kāi)封第一講書(shū)人閱讀 39,129評(píng)論 0 276
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎讯私,沒(méi)想到半個(gè)月后热押,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,561評(píng)論 1 314
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡斤寇,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,779評(píng)論 3 335
  • 正文 我和宋清朗相戀三年桶癣,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片娘锁。...
    茶點(diǎn)故事閱讀 39,902評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡牙寞,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出莫秆,到底是詐尸還是另有隱情间雀,我是刑警寧澤,帶...
    沈念sama閱讀 35,621評(píng)論 5 345
  • 正文 年R本政府宣布镊屎,位于F島的核電站惹挟,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏杯道。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,220評(píng)論 3 328
  • 文/蒙蒙 一责蝠、第九天 我趴在偏房一處隱蔽的房頂上張望党巾。 院中可真熱鬧,春花似錦霜医、人聲如沸齿拂。這莊子的主人今日做“春日...
    開(kāi)封第一講書(shū)人閱讀 31,838評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)墨辛。三九已至,卻和暖如春攒巍,著一層夾襖步出監(jiān)牢的瞬間匣摘,已是汗流浹背。 一陣腳步聲響...
    開(kāi)封第一講書(shū)人閱讀 32,971評(píng)論 1 269
  • 我被黑心中介騙來(lái)泰國(guó)打工粗卜, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 48,025評(píng)論 2 370
  • 正文 我出身青樓踱启,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親研底。 傳聞我的和親對(duì)象是個(gè)殘疾皇子埠偿,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,843評(píng)論 2 354

推薦閱讀更多精彩內(nèi)容