在AngularJS 1.3的变化 [英] Changes in AngularJS 1.3

查看:178
本文介绍了在AngularJS 1.3的变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始与AngularJS和我正在经历一系列的Hello World的例子,我不能让他们对图书馆的分支1.3运行。

I've just started with AngularJS and I was going through a set of Hello World examples and I can't get them running on branch 1.3 of the the library.

HTML code

<html ng-app>
<head>
  <script src="angular.js"></script>
  <script src="controller.js"></script>
</head>
<body>
  <div ng-controller='HelloController'>
    <input ng-model='greeting.text'>
    <p>{{greeting.text}}, World</p>
  </div>
</body>
</html>

controller.js

function HelloController($scope) {
  $scope.greeting = { text: 'Hello' };
}

这工作在1.2罚款。
我找不到已在1.3已经取得导致此。

This works fine in 1.2. I couldn't find the changes that have been made in 1.3 that cause this.

推荐答案

由于角1.3测试版15,$控制器不找控制器上了窗户。 <一href=\"https://github.com/angular/angular.js/blob/master/CHANGELOG.md#130-beta15-unbelievable-advancement-2014-07-11\"相对=nofollow>的AngularJS的changelog解释以明确的方式是什么precisely改变(滚动到重大更改部分)。

Since Angular 1.3 beta 15, $controller does not look for controllers anymore on window. The AngularJS changelog explains in a clear manner what precisely has changed (scroll to the 'Breaking Changes' section).

这篇关于在AngularJS 1.3的变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆