美文网首页我爱编程
Begin with Angular

Begin with Angular

作者: George_Zeng | 来源:发表于2016-12-12 23:38 被阅读0次

用intellij+angular写一个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 !

相关文章

  • Begin with Angular

    用intellij+angular写一个index.html Greate a static web projec...

  • C++:vector的begin()& end()&front(

    1.begin()函数 函数原型:iterator begin();const_iterator begin();...

  • SQL事务语法及表的死锁处理

    Begin try Begin Transaction /////////////////////////具体代码...

  • Begin

    朋友推荐,我的简书第一篇。 开学已经一个多月了,很讨厌自己的状态。也许因为班委的原因,也许因为最近家里的不幸,我,...

  • Begin

    把一些话 放到这里来吧。早就有打算开始 固定着让自己写一些什么下来或许这也是 强迫自己去思考一些事情的方式吧 喜欢...

  • begin

    失望

  • Begin

    终于还是走到这一步,也确实会走到这一步。听话才给糖吃,有自己的想法就是蹬鼻子上脸不知足。这还怎么沟通呢?!时至此日...

  • to begin with

    秋渐凉 2018年10月8日,晚上10点52分 八点下班,开始往家赶,两班公交,九点多到家 外面秋风呼啸,刷了微博...

  • Begin

    2018.1.11,今天是第一次用简书,在上面写东西,看到一个学姐经常发一些文章,感想或者影评,嗯…感觉挺棒的,有...

  • begin

    前两天无意之中刷微博看到了推荐一条有趣软件的微博,在里面看到了简书,截了张图,在手机里放了几天,终于在一个百无聊赖...

网友评论

    本文标题:Begin with Angular

    本文链接:https://www.haomeiwen.com/subject/zwjvmttx.html