<a href='https://github.com/angular/angular.js/edit/v1.6.x/docs/content/guide/migration.ngdoc?message=docs(guide%2FMigrating from Previous Versions)%3A%20describe%20your%20change...' class='improve-docs btn btn-primary'><i class="glyphicon glyphicon-edit"> </i>Improve this Doc</a>
<h1 id="migrating-an-app-to-a-newer-version">Migrating an App to a newer version</h1>
<p>Minor version releases in AngularJS introduce several breaking changes that may require changes to your
application's source code; for instance from 1.0 to 1.2 and from 1.2 to 1.3.</p>
<p>Although we try to avoid breaking changes, there are some cases where it is unavoidable:</p>
<ul>
<li>AngularJS has undergone thorough security reviews to make applications safer by default,
which drives many of these changes.</li>
<li>Several new features, especially animations, would not be possible without a few changes.</li>
<li>Finally, some outstanding bugs were best fixed by changing an existing API.</li>
</ul>
<h2 id="contents">Contents</h2>
<ul class="nav nav-list">
<li><a href="guide/migration#migrating-from-1-5-to-1-6">Migrating from 1.5 to 1.6</a></li>
<li><a href="guide/migration#migrating-from-1-4-to-1-5">Migrating from 1.4 to 1.5</a></li>
<li><a href="guide/migration#migrating-from-1-3-to-1-4">Migrating from 1.3 to 1.4</a></li>
<li><a href="guide/migration#migrating-from-1-2-to-1-3">Migrating from 1.2 to 1.3</a></li>
<li><a href="guide/migration#migrating-from-1-0-to-1-2">Migrating from 1.0 to 1.2</a></li>
</ul>
<h2 id="migrating-from-1-5-to-1-6">Migrating from 1.5 to 1.6</h2>
<p>Angular 1.6 fixes numerous bugs and adds new features, both in core and in external modules.
In addition, it includes several security and performance improvements in commonly used services,
such as <code>$compile</code>, <code>$injector</code>, <code>$parse</code>, <code>$animate</code>, and directives, such as <code>input</code>, <code>ngModel</code>
and <code>select</code>.</p>
<p>The most notable changes are:</p>
<ul>
<li>Aligning jqLite with the latest version of jQuery (3.x).</li>
<li>Implementing long awaited features, such as support for inputs of type <code>range</code> and the ability to
bind to any type of values using <code>ngRepeat</code> with <code>select</code>.</li>
<li>Disabling (by default) the pre-assignment of bindings on controller instances, which helps with
support for native ES6 classes.</li>
<li>Changing the default <code>$location</code> hash-prefix to <code>'!'</code>, as the previous empty string default was
unconventional and confusing.</li>
<li>Reporting possibly unhandled promise rejections that would otherwise go unnoticed.</li>
</ul>
<p>Another major change is the removal of the <strong>Expression Sandbox</strong>. This should not require changes
to your application (and may give it a small performance boost), but we strongly recommend reading
the <a href="http://angularjs.blogspot.com/2016/09/angular-16-expression-sandbox-removal.html">Sandbox Removal Blog Post</a>
to understand the implications behind the removal and whether any action is required on your part.</p>
<p><br />
You may also notice that this release comes with a longer-than-usual list of breaking changes. Don't
let this dishearten you though, since most of them are pretty minor - often not expected to affect
real applications. These breaking changes were necessary in order to:</p>
<ul>
<li>Align with breaking changes in jQuery 3.</li>
<li>Fix bugs that we wouldn't be able to fix otherwise.</li>
<li>Introduce new features, performance improvements and security fixes.</li>
<li>Make the behavior of existing features more consistent and predictable.</li>
</ul>
<p><br />
To give you a heads-up, here is a brief summary of the breaking changes that are expected to have
the highest impact. Make sure you look them up in the full list below or check out the corresponding
commits for more info.</p>
<ul>
<li><p><strong>$location</strong> now uses <code>'!'</code> as the default hash-prefix for hash-bang URLs, instead of the empty
string. (<a href="guide/migration#commit-aa077e8">Details</a>)</p>
</li>
<li><p><strong>$compile</strong> will (by default) not pre-assign bindings on component/directive controller
instances. (<a href="guide/migration#commit-bcd0d4">Details</a>)</p>
</li>
<li><p><strong>http</strong> imposes additional restrictions to <strong>JSONP</strong> requests for security reasons
(see <a href="guide/migration#migrate1.5to1.6-ng-services-$http">details</a> below):</p>
<ul>
<li>The request URL now needs to be trusted as a resource URL.</li>
<li>You can no longer use the <code>JSON_CALLBACK</code> placeholder for specifying the query parameter for the
callback.</li>
</ul>
</li>
</ul>
<ul>
<li><strong>jqLite</strong> is more aligned to jQuery 3, which required the following changes
(see <a href="guide/migration#migrate1.5to1.6-ng-misc-jqLite">details</a> below):<ul>
<li>Keys passed to <code>.data()</code> and <code>.css()</code> are now camelCased in the same way as the jQuery methods
do.</li>
<li>Getting/setting boolean attributes no longer takes the corresponding properties into account.</li>
<li>Setting boolean attributes to empty string no longer removes the attribute.</li>
<li>Calling <code>.val()</code> on a multiple select will always return an array, even if no option is
selected.</li>
</ul>
</li>
</ul>
<ul>
<li><p><strong>input[type=radio]</strong> now uses strict comparison (<code>===</code>) to determine its "checked" status.
(<a href="guide/migration#commit-5ac7da">Details</a>)</p>
</li>
<li><p>The improved support for <strong>input[type=range]</strong> means that the behaviour of range inputs (when
bound to <code>ngModel</code>) has changed. (<a href="guide/migration#commit-913016">Details</a>)</p>
</li>
<li><p><strong>ngTransclude</strong> now treats whitespace-only transclusion content as empty and uses the fallback
content instead. (<a href="guide/migration#commit-32aa7e">Details</a>)</p>
</li>
<li><p><strong>ngAria/ngModel</strong> no longer overrides the default <code>$inEmpty()</code> method for custom
<code>checkbox</code>-shaped controls. (<a href="guide/migration#commit-975a61">Details</a>)</p>
</li>
</ul>
<p><br />
Below is the full list of breaking changes:</p>
<ul>
<li>Core:<ul>
<li><a href="guide/migration#migrate1.5to1.6-ng-directives">Directives</a><ul>
<li><a href="guide/migration#migrate1.5to1.6-ng-directives-form">form</a></li>
<li><a href="guide/migration#migrate1.5to1.6-ng-directives-input[number]">input[number]</a></li>
<li><a href="guide/migration#migrate1.5to1.6-ng-directives-input[radio]">input[radio]</a></li>
<li><a href="guide/migration#migrate1.5to1.6-ng-directives-input[range]">input[range]</a></li>
<li><a href="guide/migration#migrate1.5to1.6-ng-directives-ngBind">ngBind</a></li>
<li><a href="guide/migration#migrate1.5to1.6-ng-directives-ngModel">ngModel</a></li>
<li><a href="guide/migration#migrate1.5to1.6-ng-directives-ngModelOptions">ngModelOptions</a></li>
<li><a href="guide/migration#migrate1.5to1.6-ng-directives-ngTransclude">ngTransclude</a></li>
<li><a href="guide/migration#migrate1.5to1.6-ng-directives-select">select</a></li>
</ul>
</li>
<li><a href="guide/migration#migrate1.5to1.6-ng-services">Services</a><ul>
<li><a href="guide/migration#migrate1.5to1.6-ng-services-$compile">$compile</a></li>
<li><a href="guide/migration#migrate1.5to1.6-ng-services-$http">$http</a></li>
<li><a href="guide/migration#migrate1.5to1.6-ng-services-$interpolate">$interpolate</a></li>
<li><a href="guide/migration#migrate1.5to1.6-ng-services-$location">$location</a></li>
<li><a href="guide/migration#migrate1.5to1.6-ng-services-$q">$q</a></li>
</ul>
</li>
<li><a href="guide/migration#migrate1.5to1.6-ng-misc">Miscellaneous</a><ul>
<li><a href="guide/migration#migrate1.5to1.6-ng-misc-jqLite">jqLite</a></li>
<li><a href="guide/migration#migrate1.5to1.6-ng-misc-decorator">decorator()</a></li>
</ul>
</li>
</ul>
</li>
<li>Modules:<ul
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
AngularJS 1.6.6 所有文件 (2000个子文件)
bootstrap.css 118KB
bootstrap.min.css 98KB
docs.css 18KB
angular-topnav.css 4KB
doc_widgets.css 3KB
prettify.css 2KB
prettify-theme.css 1KB
styles.css 1KB
animations.css 684B
animations.css 599B
animations.css 591B
animations.css 589B
animations.css 569B
animations.css 540B
animations.css 540B
animations.css 492B
animations.css 458B
style.css 393B
style.css 393B
style.css 379B
angular-csp.css 343B
animations.css 343B
style.css 303B
style.css 299B
style.css 281B
style.css 268B
style.css 236B
animations.css 224B
animations.css 224B
style.css 196B
animations.css 179B
style.css 137B
style.css 136B
style.css 125B
style.css 103B
style.css 98B
style.css 74B
app.css 60B
style.css 47B
style.css 47B
style.css 27B
style.css 24B
animations.css 0B
migration.html 147KB
ng.html 59KB
$compile.html 58KB
$httpBackend.html 52KB
directive.html 51KB
component-router.html 47KB
$sce.html 44KB
$http.html 41KB
$location.html 41KB
$rootScope.Scope.html 38KB
ngAnimate.html 34KB
ngModel.NgModelController.html 33KB
$animate.html 30KB
orderBy.html 30KB
forms.html 28KB
$httpBackend.html 27KB
scope.html 26KB
component.html 24KB
animations.html 24KB
i18n.html 24KB
compiler.html 23KB
concepts.html 22KB
unit-testing.html 22KB
step_14.html 22KB
$resource.html 22KB
accessibility.html 21KB
$compileProvider.html 21KB
decorators.html 20KB
directive.html 20KB
$q.html 20KB
select.html 20KB
faq.html 19KB
$provide.html 19KB
expression.html 19KB
ngRepeat.html 19KB
step_09.html 18KB
providers.html 18KB
ngOptions.html 18KB
$location.html 18KB
controller.html 17KB
angular.Module.html 17KB
ngMessages.html 16KB
$route.html 15KB
ngModelOptions.html 15KB
tutorial.html 15KB
step_02.html 14KB
$animateCss.html 14KB
inprog.html 14KB
di.html 14KB
$routeProvider.html 14KB
external-resources.html 14KB
step_07.html 14KB
step_04.html 13KB
ngController.html 13KB
ngInclude.html 13KB
module.html 12KB
$injector.html 12KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
- binxigogo2017-10-12没有下载下来,再下载一次
Chocus
- 粉丝: 3
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功