我是新来的网络前端编程,并教我自己AngularJS。如何/在哪里导入我的index.html中的Angular和Bootstrap .js文件?
我创建了一个非常简单的web应用程序,只是让用户登录和注销。我在我的Mac OSX本地运行它。
以下是我的index.html
文件。虽然它有效,但我不知道我是否正确。我需要知道如何以及在哪里导入angular.js文件和bootstrap.js文件。
我的问题如下。我一直无法通过谷歌搜索找出这些东西。我需要有人向我解释这个东西。
- 我正在从
https://ajax.googleapis.com
导入angular.js
文件。那是对的吗?或者我应该下载它并将该文件存储在与index.html
相同的目录中?为什么?我应该何时使用非缩小文件?使用非缩小的有什么好处? - 我目前没有导入任何引导文件。我应该导入哪些文件?我是否应该将其作为URL或作为来自同一目录的文件导入:
index.html
- 对于Bootstrap和AngularJS,
- 我应该检查Angular和Bootstrap文件到我的Github存储库吗?
的index.html:
<html ng-app="app">
<head>
</head>
<body ng-controller="Main as main">
<input type="text" ng-model="main.username" placeholder="username">
<br>
<input type="password" ng-model="main.password" placeholder="password">
<br>
<br>
<button ng-click="main.login()" ng-hide="main.isAuthed()">Login</button>
<button ng-click="main.logout()" ng-show="main.isAuthed()">Logout</button>
<br/> {{main.message}}
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0-beta.5/angular.min.js"></script>
<script src="app.js"></script>
</body>
</html>