对安装angularjs感到困惑。发现许多依赖项

对安装angularjs感到困惑。发现许多依赖项,angularjs,Angularjs,我在谷歌上搜索了安装angularjs。我找到了很多教程,但我很困惑。我找到了 角形种子 约曼 凉亭 等 必须使用此依赖项。 启动angularjs有任何划痕。对于angularjs,您不需要任何依赖项。只是为了包括angularjs库,比如jquery或任何其他库。请看这里: <!doctype html> <html ng-app="todoApp"> <head> <script src="https://ajax.googleapis.com/

我在谷歌上搜索了安装angularjs。我找到了很多教程,但我很困惑。我找到了

角形种子 约曼 凉亭 等 必须使用此依赖项。
启动angularjs有任何划痕。

对于angularjs,您不需要任何依赖项。只是为了包括angularjs库,比如jquery或任何其他库。请看这里:

<!doctype html>
<html ng-app="todoApp">
<head>
<script  src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.min.js"></script>
<script src="todo.js"></script>
<link rel="stylesheet" href="todo.css">
</head>
<body>
<h2>Todo</h2>
<div ng-controller="TodoListController as todoList">
  <span>{{todoList.remaining()}} of {{todoList.todos.length}} remaining</span>
  [ <a href="" ng-click="todoList.archive()">archive</a> ]
  <ul class="unstyled">
    <li ng-repeat="todo in todoList.todos">
      <label class="checkbox">
        <input type="checkbox" ng-model="todo.done">
        <span class="done-{{todo.done}}">{{todo.text}}</span>
      </label>
    </li>
  </ul>
  <form ng-submit="todoList.addTodo()">
    <input type="text" ng-model="todoList.todoText"  size="30"
           placeholder="add new todo here">
    <input class="btn-primary" type="submit" value="add">
  </form>
 </div>
 </body>
</html>
为了便于理解,我从中选取了这个示例


但如果您想在其他库中扩展angular功能,那么您需要包括这些依赖项,就像您所说的

感谢rahul的回复。我想添加引导和另一个依赖项。这是手动添加或由任何包管理器添加的最佳方法。@Bharatangar在我的示例中,如果您想添加引导,请使用:angular.module'todoApp',[]>>angular.module'app',['ui.bootstrap'],我建议您阅读以下答案:。始终阅读文档:
angular.module('todoApp', [])
.controller('TodoListController', function() {
 var todoList = this;
 todoList.todos = [
  {text:'learn angular', done:true},
  {text:'build an angular app', done:false}];

 todoList.addTodo = function() {
  todoList.todos.push({text:todoList.todoText, done:false});
  todoList.todoText = '';
 };

 todoList.remaining = function() {
  var count = 0;
  angular.forEach(todoList.todos, function(todo) {
    count += todo.done ? 0 : 1;
  });
  return count;
 };

 todoList.archive = function() {
  var oldTodos = todoList.todos;
  todoList.todos = [];
  angular.forEach(oldTodos, function(todo) {
    if (!todo.done) todoList.todos.push(todo);
  });
 };
 });