Note: 1.1.x releases are considered unstable.
- $http: support custom reponseType (e0a54f6b, #1013)
- $interpolate:
- $sniffer: auto detect CSP mode (currently requires Chrome on dev channel) (167aa0c2)
This release also contains all bug fixes available in 1.0.2.
- $compile: denormalize directive templates (dfe99836)
- $interpolate: $interpolateProvider.endSymbol() returns startSymbol (20348717)
- jqLite: better support for xhtml (d3fa7a2e, #1301)
- mocks: free up memory after every spec (1a8642aa)
- e2e test runner: Adding meta tag to avoid cache issues (5318588d)
- Directives:
- Conceptual Overview of AngularJS (high level overview of how things work): http://docs.angularjs.org/guide/concepts (7a5f25f6)
- Lots of spelling, grammar and other fixes: 9a710c78, 847d2da0, dbefd671, cab5e1d9, f00b6cca, 2e365168, 536de148, a1107e81, 5ef9ed87, 8c81a0f3, bde931af, 6553fe68, 13b5fd1b, 17209d5b, 31c82560, ab6937e2, fbfda241, 206371b7, b6b92bd8, 79f2d843, 64a9cd8f, 7f6e1326, 1fd2b3d4, d56d69cc, 01e726b2, 16136216, 92a3d282, 4c585019, c076fe08, 2473412b, 1f2d5000, 5026315d, f0a090dd, 6d9313a6) and more!
- $location: don't throw exception while url rewriting if element was removed (3da4194f, #1058)
- $location: prevent ie from getting into redirect loop (ffb27013, #1075, #1079, #1085)
- $location:
- $route:
- $compile: simplify isolate scope bindings and introduce true two-way data-binding between parent scope and isolate scope (c3a41ff9)
- $injector: provide API for retrieving function annotations (4361efb0)
- $location: add $locatonChange[start|success] event - since events are cancelable, it's now possible to cancel route and location changes. (92a2e180)
- $rootElement: expose application root element as $rootElement service (85632cb4)
- $compile: correctly merge class attr for replace directives (contributed by Max Martinsson, fb99b539, #1006)
- $http: add utf-8 to default Content-Type header (post/put) (10f80d7d)
- $timeout: allow calling $timeout.cancel() with undefined (contributed by Ali Mills, 1904596e)
- jqLite: don't eat event exceptions (416a7830)
-
$beforeRouteChange and $afterRouteChange events were renamed to $routeChangeStart and $routeChangeSuccess
This was done to make the naming consistent with $location events and also get events to categorize and order nicely just by alphabetical sorting.
(7c242821)
-
template
option in $route definition was renamed totemplateUrl
The
template
options in $route definition now represents the actual template string. To provide the template url usetemplateUrl
option instead. This was done to unify the directive and $route definitions.To migrate just rename
template
totemplateUrl
. (0a6e464a) -
isolate scope bindings definition has changed
To migrate the code follow the example below:
Before:
scope: { myAttr: 'attribute', myBind: 'bind', myExpression: 'expression', myEval: 'evaluate', myAccessor: 'accessor' }
After:
scope: { myAttr: '@', myBind: '@', myExpression: '&', // myEval - usually not useful, but in cases where the expression is assignable, you can use '=' myAccessor: '=' // in directive's template change myAccessor() to myAccessor }
-
the inject option for the directive controller injection was removed
The removed
inject
wasn't generally useful for directives so there should be no code using it. (c3a41ff9)
- $timeout: add
$timeout
service that supersedes$defer
(4511d39c, #704, #532) - scope: add
event.preventDefault()
andevent.defaultPrevented
(84542d24)
- ngRepeat: expose
$first
,$middle
and$last
instead of$position
(1d388676, #912) - jqLite: use the same expando store structure as jQuery (acf095d1)
- $rootScope: infinite digest exception does not clear $$phase (5989a1ed, #979)
-
ngRepeat -
$position
is not exposed in repeater scopes any moreTo update, search for
/\$position/
and replace it with one of$first
,$middle
or$last
. (1d388676) -
scope event's
cancel
method was renamed tostopPropagation
The name was corrected in order to align better with DOM terminology. To update, search for
/\.\s*cancel\s*(/
and replace it with.stopPropagation(
or.preventDefault(
(or both) depending on what you actually need. (91db9920)
-
$defer
service has been deprecated in favor of$timeout
serviceThe
$defer
service will be removed before 1.0 final, so please migrate your code. (4511d39c)
- $location:
- docs app: get docs app to work on IE8 (aa025348)
- jqLite: support data() getter and data(obj) setter (ee579a07)
- $compile:
- have $observe return registration function (7f0eb151)
- ignore ws when checking if template has single root (9c0418cf, #910)
- fix replaceWith (b431ee38)
- attach scope to the directive element when templateUrl and replace=true (705f4bbf)
- prevent duplicate directive controller instantiation (843f762c, #876)
- $parse: support methods on falsy primitive types (499a76a0)
- ngModel: use keydown/change events on IE9 instead of input (49dfdf8f, #879)
- ngSrc,ngHref: binding should set element prop as well as attr (b24cc63b, #935)
- scenario: make browser().location() working if ng-app on other than (5bcb749a)
- select: don't interfere with selection if not databound (3bd3cc57, #926)
- Brand new bootstrap-based skin for api docs: http://docs.angularjs.org/
- jqlite:
- Tutorial has been finally updated to AngularJS v1.0! Check it out and provide feedback to make it even better: http://docs.angularjs.org/tutorial
- http://docs-next.angularjs.org now redirects to http://docs.angularjs.org
- select: properly handle empty & unknown options without ngOptions (904b69c7)
- compiler: reading comment throws error in ie (46bb08a9)
- document: accidental clobbering of document.getAttribute (eafe15f5, #877)
- script: Incorrectly reading script text on ie (94dd6857)
- $location: properly rewrite urls in html5 mode with base url set + don't rewrite links to different base paths (6d7e7fde, 0a5050eb)
- e2eRunner: $browser.location should delegate to apps $location (df72852f)
- input.radio: support 2-way binding in a repeater (93d62860, #869)
- ngBindHtml: clear contents when model is falsy (10daefc6, #864)
- lots of doc fixes
- $http: expose the defaults config as $http.defaults (dceafd32)
- docs: steps 0-4 of the Tutorial have been updated and improved
-
ng-ext-link
directive was removed because it's unnecessary (6d7e7fde)apps that relied on ng-ext-link should simply replace it with
target="_self"
-
$browser.addCss
was removed - it was never meant to be a public api (13d5528a)apps the depend on this functionality should write a simple utility function specific to the app (see this diff for hints).
-
$browser.addJs
method was removed - it was never meant to be a public api (fbaa1968)apps that depended on this functionality should either use many of the existing script loaders or create a simple helper method specific to the app.
-
$sanitize
service,ngBindHtml
directive andlinky
filter were moved to thengSanitize
module (5bcd7198)apps that depend on any of these will need to load
angular-sanitize.js
and includengSanitize
in their dependency list:var myApp = angular.module('myApp', ['ngSanitize']);
- $compile: relax the restriction that directives can not add siblings (7e86eacf)
- $location: search setter should not double-encode the value (59fa40ec, #751)
- $q: $q.reject should forward callbacks if missing (c0b78478, #845)
- build: move
'use strict';
flag into the angular closure (637817e3) - Directives:
- ngModel: update model on each key stroke (revert ngModelInstant) (06d09550)
- booleanAttrs: always convert the model to boolean before setting the element property (dcb8e076)
- form: preperly clean up when invalid widget is removed (21b77ad5)
- ngHref: copy even if no binding (2f5dba48)
- ngInclude: fire $includeContentLoaded on proper (child) scope (199ac269)
- $http: add
withCredentials
config option (86182a94) - $route: allow chaining of whens and otherwise (15ecc6f3)
- ngInclude: allow ngInclude as css class (428f2b56)
- reintroduced the tutorial docs - currently only steps 0-3 are up to date and the code is not split up into step specific commits yet. See this branch instead.
- various other doc fixes
We removed two useless features:
- $routeProvider.when used to return the route definition object but now it returns self (15ecc6f3)
- ngInclude does not have scope attribute anymore (5f70d615)
- ngModelInstant directive is no more and ngModel behaves just as ngModelInstant used to. This doesn't really break anything, just remember to remove all ngModelInstant references from your template as they serve no purpose now. (06d09550)
- $compile:
- angular.forEach: should ignore prototypically inherited properties (8d7e6948, #813)
- initialization: use jQuery#ready for initialization if available (cb2ad9ab, #818)
- $q: resolve all of nothing to nothing (ac75079e)
- $compile: do not interpolate boolean attribute directives, rather evaluate them (a08cbc02)
- $controller: support controller registration via $controllerProvider (d54dfecb)
- $http:
- TzDate: add support for toISOString method (da9f4dfc)
- jqLite: make injector() and scope() work with the document object (5fdab52d)
- ngValue: directive that allows radio inputs to have non string values (09e175f0, #816)
$resource
,$cookies
and$cookieStore
services are now distributed as separate modules, seeangular-resource.js
andangular-cookies.js
. (798bca62, 7b22d59b)- angular.fromJson doesn't deserialize date strings into date objects. (ac4318a2)
- angular.toJson always use native JSON.parse and JSON.stringify - this might break code that consumes the output in whitespace-sensitive way (35125d25)
- IE7 and older have are now required to polyfill the JSON global object (87f5c6e5)
- boolean attr directives (ng-disabled, ng-required, etc) are evaluated rather than interpolated (a08cbc02)
ng-bind-attr
directive removed (55027132)- any app that depends on $sniffer service should use Modernizr instead (aaedefb9)
- $route: when matching consider trailing slash as optional (a4fe51da)
- jqLite: add .controller() method (6c5a05ad)
- scope.$eval: allow passing locals to the expression (192ff61f)
- input[type=radio]: allow the value attribute to be interpolated (ade6c452)
- $http: don't send Content-Type header when no data (1a5bebd9, #749)
- $resource: support escaping of ':' in resource url (6d6f8753)
- $compile:
- $log: avoid console.log.apply calls in IE (15213ec2, #805)
- json: added support for iso8061 timezone (5ac14f63)
- e2e runner: fix typo that caused errors on IE8 (ee5a5352, #806)
- directives:
The compiler was completely rewritten from scratch using ideas from this design document. Please check out the $compile and $compileProvider.directive docs. The biggest improvements and changes are listed below.
-
the compiler now transparently supports several directive syntaxes. For example while before there was just one way to use
ng:include
directive:<ng:include src="someSrc"></ng:include>
. The new compiler treats all of the following as equivalent:<ng:include src="someSrc"></ng:include>
<ng-include src="someSrc"></ng-include>
<x-ng-include src="someSrc"></x-ng-include>
<div ng:include src="someSrc"></div>
<div ng-include src="someSrc"></div>
<div data-ng-include src="someSrc"></div>
<div ng:include="someSrc"></div>
<div ng-include="someSrc"></div>
<div data-ng-include="someSrc"></div>
<div class="ng-include: someSrc"></div>
This will give template creators great flexibility to consider the tradeoffs between html code validity and code conciseness and pick the syntax that works the best for them.
-
we are switching all of our code/docs/examples to use
ng-foo
directive name style instead ofng:foo
. The new compiler doesn't distinguish between these and other name styles (all of them are equally supported), the main difference is thatng-foo
is easier to select with css selectors. Check out the Internet Explorer Compatibility doc to learn about various IE-related requirements for different directive naming styles. -
angular.directive
,angular.widget
,angular.attrWidget
were merged into a single concept: adirective
which is registered via myModule.directive or $compileProvider.directive. You can control execution priority of multiple directives on the same element (previously the main difference between a attribute widget and a directive) via a directive priority setting. -
previously the linking functions of directives were called top to bottom following the DOM tree, to enable a linking fn to work child DOM nodes that were already processed by child linking fns the order was changed as follows: compile functions run top to bottom following the DOM tree, but linking functions run bottom-up following the DOM tree. In some rare cases it is desirable for linking fns to be called top to bottom and for these it is possible to register "prelinking" functions (check out the docs for the return value of the compile function).
-
angular.markup
andangular.attrMarkup
were replaced with interpolation via$interpolate
service.-
In the past
{{foo}}
markup was getting translated to<span ng-bind="foo"></span>
during the early stage of template compilation. Addition of this extra node was in some cases undesirable and caused problems. The new compiler with the help of the $interpolate service removes the need for these artificial nodes. -
As a side-effect of not using artificial nodes available for all bindings, the
html
filter which used to innerHTML (sanitized) html into the artificial node was converted into a directive. So instead of{{ someRawHtml | html }}
use<div ng-bind-html="someRawHtml"></div>
and instead of{{ someRawHtml | html:"unsafe" }}
use<div ng-bind-html-unsafe="someRawHtml"></div>
. Please check out the ng-bind-html and ng-bind-html-unsafe directive docs. -
Custom markup has been used by developers only to switch from
{{ }}
markup to(( ))
or something similar in order to avoid conflicts with server-side templating libraries. We made it easier to do this kind of customization by making the start and end symbol of the interpolation configurable via $interpolateProvider.
-
-
template loader loads template fragments from script elements and populates the $templateCache with them. Templates loaded in this way can be then used with
ng-include
,ng-view
as well as directive templates (see thetemplateUrl
property of the directive config object).
The implementation of forms and input bindings was modified to address issues around composability, ease of adding custom validation and formatting. Please check out the forms dev guide article to learn about forms, form control bindings and input validation. The biggest changes are listed below.
-
any directive can add formatter/parser (validators, convertors) to an input type. This allows better composability of input types with custom validators and formatters. So instead of creating new custom input type for everything, it's now possible to take existing input type and add an additional formatter and/or validator to it via a custom directive.
-
inputs propagates changes only on the blur event by default (use new
ng-model-instant
directive if you want to propagate changes on each keystroke). -
no more custom input types, use directives to customize existing types.
-
removed $formFactory.
-
removed parallel scope hierarchy (forms, widgets).
-
removed
list
input type (useng-list
directive instead). -
removed integer input type.
Controllers are now standalone objects, created using the "new" operator, and not mixed with scope object anymore. This addresses many issues including: #321 and #425.
The design doc explains the reasoning for this major change and how it solves many issues.
function MyCtrl() { var self = this; this.model = 'some model of any type'; this.fnUsedFromTemplate = function() { someApiThatTakesCallback(function callbackFn() { self.model = 'updatedModel'; }); }; }
function MyCtrl($scope) { $scope.model = 'some model of any type'; $scope.fnUsedFromTemplate = function() { someApiThatTakesCallback(function() { $scope.model = 'updatedModel'; }); } }
Temporary backwards compatibility: Load the following module in your app to recreate the previous behavior and migrate your controllers one at a time: https://gist.github.com/1649788
-
As advertised in the past we moved the $route configuration from the run phase of the application to the config phase. This means that instead of defining routes via
$route.when
/$route.otherwise
you should use$routeProvider.when
/$routeProvider.otherwise
instead. -
route scope is now being created by the
ng-view
rather than by$route
, this resolved many issues we've previously faced. For more info, read the commit message. -
removed
$route.parent()
- it's unnecessary because the scope is properly created in the scope hierarchy byng-view
. -
new
$viewContentLoaded
and$includeContentLoaded
events which directives can use to be notified when a template content is (re)loaded. -
ng-view
now hasonload
attribute which behaves similarly to the one onng-include
.
ng-model
binding on select[multiple] element should support binding to an array (commit)- event object is now accessible as
$event
inng-click
and other directives (commit, issue #259 ng-class
directive now support map of classnames and conditions e.g.<div ng-class="{'hide': !visible, 'warning': isAlert()}"...
(contributed by Kai Groner) (commit)
-
scope.$emit
/$broadcast
return the event object, add cancelled property (commit) -
scope.$new()
takes one argument - a boolean indicating if the newly-created child scope should be isolated (not prototypically inheriting from the current scope). Previously the first argument was reference to the controller constructor, but because of the scope/controller separation the controllers should be instantiated via the$controller
service. (commit) -
fn signature change for change listener functions registered via
scope.$watch
- this means that the scope object can be listed in the arguments list only if its needed and skipped otherwise. (commit)- before:
scope.$watch('someModel', function(scope, newVal, oldVal) {})
- after:
scope.$watch('someModel', function(newVal, oldVal, scope) {})
- before:
-
scope.$watch
now compares object by reference and only if extra boolean flag is passed comparison by equality is used. This was done to avoid unintended performance issues. (commit)- before:
scope.$watch('expression', function(scope, newVal, oldVal) {})
- after:
scope.$watch('expression', function(newVal, oldVal, scope) {}, true)
- before:
-
scope.$destroy
doesn't cause the$destroy
event to be emitted any more - this event was primarily used by the old forms implementation and is not needed any more. We are considering broadcasting this event in the future, which could then be used by directives and child scopes to be notified of their scope destruction.
$injector.instantiate
should return the object returned from constructor if one was returned (commit)$injector.instantiate
should support array annotations for Type argument (e.g. instantiate(['dep1', 'dep2', Type])) (commit)- quickly fail if circular dependencies are detected during instantiation (commit)
- added $provide.constant to enable registration of constants that are available in both the config and run phase (commit)
$provide.service
was renamed to $provide.provider (commit)$provide.service
takes a constructor fn and creates a service instance by using $injector.instantiate
- added
contents()
(commit) - added
wrap()
(commit) - fix memory leaking in IE8 (remove monkey patched methods on Event) (commit, commit)
- fix incorrect comparison of dates by angular.equals (commit)
scope.$watch
support watching functions (commit, commit)$http
should not json-serialize File objects, instead just send them raw (commit)$compile
should ignore content of style and script elements (commit, commit)TzDate#getDay()
should take into account the timezone offset (contributed by Stephane Bisson) (commit)
$parse
service now supports local vars in expressions (commit)
- Dependency injection subsystem rewrite. This is a huge change to the Angular core that was necessary for many reasons. Please read the full design doc to understand the changes and reasoning behind them.
- Added angular.bootstrap for manual bootstrapping of the app. Also see Initializing Angular App doc.
- Helper functions inject and module that make testing with DI and jasmine a lot easier.
- jqLite and jQuery were extended with helper method
injector()
that simplifies the access to the application injector during debugging. - Rewrite of $xhr service and its dependencies, which was replaced with $http service. The $browser.xhr and its mock were replaced by $httpBackend and its unit testing and end-to-end testing mocks. The $resource service api and functionality was preserved, with the exception of caching, which is not happening automatically as it used it in the past (verifyCache has no effect).
- $q - Q-like deferred/promise implementation (commit)
- Transparent data-binding to promises in templates. Example (commit)
- New $anchorScroll service that watches url hash and navigates to the html anchor even if the content was loaded via ng:view (for ng:include you have to opt into this behavior using autoscroll attribute)
- New LRU cache factory - $cacheFactory service
- jQuery 1.7 compatibility
- Directive names are now case insensitive (commit)
- $location#url setter fix (Issue #648)
- ng:include - prevent race conditions by ignoring stale http callbacks (commit)
- ng:repeat - support repeating over array with null (commit)
- angular.copy - throw Error if source and destination are identical (commit)
- Forms should not prevent POST submission if the action attribute is present (commit)
- App bootstrapping works differently (see angular.bootstrap and ng:app and bootstrapping)
- scope.$service is no more (because injector creates scope and not the other way around), if you really can't get services injected and need to fetch them manually then, get hold of $injector service and call $injector.get('serviceId')
- angular.service style service registration was replaced with module system, please see angular.module api and DI documentation for more info.
- the $xhr service was replaced with $http with promise based apis.
- unit-testing $httpBackend's expect method (the replacement for $browser.xhr.expect) is stricter - the order of requests matters and a single request expectation can handle only a single request.
- compiler
- compiler is a service, so use $compile instead of angular.compile to compile templates
- $compile (nee angular.compile) returns the linking function which takes one mandatory argument - the scope. previously this argument was optional and if missing, the compiler would create a new root scope, this was a source of bugs and was removed
- filters
- filters need to be registered either via moduleName.filter or $filterProvider.filter
- filters don't have access to the dom element
- currency filter doesn't make negative values red
- json filter doesn't print out stuff in monospace
- type augmentation via angular.Array, and angular.Object is gone. As a replacement use filters (filter, limitTo, orderBy), ES5 apis (e.g. Array#indexOf), or create custom filters (e.g. as a replacement for $count and $sum).
- $browser.defer.flush now throws an exception when queue is empty (commit)
- scope.$apply and scope.$digest throws an exception if called while $apply or $digest is already in progress (this is a programming error, you should never need to do this) (commit)
- ng:autobind: drop angular.js file name restrictions (commit)
- Scope: better logging of infinite digest error (commit, issue #621)
- enable widget styling in IE8 and below using html5shiv-like approach (commit, issue #584)
- ng:style: compatibility + perf improvements (commit)
- ng:view: ignore stale xhr callbacks - fixes issues caused by race-conditions which occured when user navigated to a new route before the current route finished loading (issue #619)
- ng:form should always be a block level (css) element (commit)
- Fixes for e2e test runner's
$location
dsl (commit) - ng:repeat when iterating over arrays ignore non-array properties + when iterating over objects sort keys alphabetically (commit)
- experimental disqus.com integration for all docs-next.angularjs.org pages (commit, contributed by Dan Doyon)
- e2e test runner docs were moved to the dev guide
- New validation options for
input widgets:
ng:minlength
andng:maxlength
(commit) (contributed by Konstantin Stepanov) - HTML sanitizer was updated to recognize all safe HTML5 elements (Issue #89)
- ng:options' blank option is now compiled and data-bound as any other template (Issue #562) (contributed by tehek)
- $defer service now exposes
cancel
method for task cancellation (commit)
- ng:options should select correct element when '?'-option (invalid value) was previously selected (Issue #599) (contributed by Tehek)
- Fix data-binding of radio button's value property (Issue #316)
- Input with type
password
should no be turned into a readable text field (commit) (contributed by Konstantin Stepanov) - ng:repeat should ignore object properties starting with
$
(commit) - Correctly parse out inlined regexp from the input field's
ng:pattern
attribute. (commit) - $location service in html5 mode should correctly rewrite links that contain nested elements (commit)
- the date filter now uses 'mediumDate' format if none is specified. This was done to deal with browser inconsistencies (each browser used to use different format) (Issue #605, commit, commit)
- calling the linker function returned by angular.compile doesn't automatically run
$digest
on the linked scope any more. This behavior was briefly introduced in 0.10.3 but was causing issues and inefficiencies in production apps so we reverted it. See: commit
-
New forms, validation, support for HTML5 input widgets. Please check out:
-
ng:repeat now has element-model affinity, which makes it more friendly to third-party code that is not aware of angular's DOM manipulation. This is also the pre-requisite for supporting animations. (commit)
- The select widget with ng:options directive now correctly displays selected option (regression from 0.10.2).
- Fix for jqLite's removeClass, which under certain circumstances could clobber class names. (commit)
- Other small fixes and documentation improvements.
- Due to changes in how forms and validation works the following were replaced with new apis:
angular.formatter
- useangular.inputType
or form's$createWidget
angular.validator
- useangular.inputType
or form's$createWidget
- changes to
<input>
and<select>
elementsng:model
directive is now required for data-binding to kick in- the
name
attribute is now optional and is used only as an alias when accessing the input widget via the form object. - view can't affect the model without a user interaction, so the
value
attribute of the<input>
element andselected
attribute of the<option>
element if specified in the template is ignored.
- Removed decoration of DOM elements when:
- an exception occurs - when an exception happens, it will be passed to the $exceptionHandler service, which can decide what to do with it.
- an input widget contains invalid input - in this case the forms validation apis can be used to display a customized error message.
- The $hover service was removed (it was needed only for the DOM decoration described above).
- Added support for short-circuiting of && and || operators in in angular expressions (Issue #433)
- Fix for $limitTo to properly handle excessive limits (contributed by tehek) (Issue #571)
- jqLite's css() method now converts dash-separated css property names to camelCase in order to support dash-separated properties on Firefox (Issue #569)
- action defaults for $resources now take precedence over resource defaults (contributed by Marcello Nuccio) (commit)
- Fixed escaping issues in $route matcher (commit)
- Fixed two issues in $browser.defer.cancel mock (commit, commit)
- Fix for ng:options, which under certain circumstances didn't select the right option element (commit)
- If Angular is being used with jQuery older than 1.6, some features might not work properly. Please upgrade to jQuery version 1.6.4.
- ng:repeat no longer has ng:repeat-index property. This is because the elements now have affinity to the underlying collection, and moving items around in the collection would move ng:repeat-index property rendering it meaningless.
- complete rewrite of the $location service with HTML5 support, many API and semantic changes.
Please see:
- $location service API docs
- $location service dev guide article
- location.js source file
- breaking changes section of this changelog
- $xhr should not covert HTTP status 0 to 200 (commit)
- fixed several doc examples that were broken on IE
- ng:change should be called after the new val is set (Issue #547)
- currency filter should return an empty string for non-numbers
- $location related changes - for complete list of api changes see:
Migrating from earlier AngularJS releases
-
$location api changes:
- $location.href -> $location.absUrl()
- $location.hash -> $location.url()
- $location.hashPath -> $location.path()
- $location.hashSearch -> $location.search()
- $location.search -> no equivalent, use $window.location.search (this is so that we can work in hashBang and html5 mode at the same time, check out the docs)
- $location.update() / $location.updateHash() -> use $location.url()
- n/a -> $location.replace() - new api for replacing history record instead of creating a new one
-
$location semantic changes:
- all url pieces are always in sync ($location.path(), $location.url(), $location.search(), ...) - this was previously true only if you used update* methods instead of direct assignment ($location.hashPath = 'foo')
- we now use (window.history.pushState || onHashChange event || polling) for detecting url changes in the browser (we use the best one available).
-
- complete rewrite of the Scope implementation with several API and semantic changes. Please see:
- angular.scope API docs
- scopes dev guide article
- scope.js source file
- breaking changes section of this changelog
- added event system to scopes (see $on, $emit and $broadcast)
- added i18n and l10n support for date, currency and number filters see i18n docs for more info
- added localizable ng:pluralize widget
- added ng:cloak directive for hiding uncompiled templates
- make ng:class friendly towards other code adding/removing classes (commit)
- several jqLite bugfixes and improvements
- ng:href, ng:src and friends now work properly when no expression is present in the attribute value. (Issue #534)
- expose missing lowercase, uppercase and isDate APIs.
- many (but not all just yet) api docs were proof-read and improved
- many scope related changes:
- $onEval is no more (use $watch with a fn as the only param if you really miss it)
- $eval without params doesn't trigger model mutation observations (use $apply/$digest instead)
- $digest propagates through the scope tree automatically (this is the desired behavior anyway)
- $watch various API changes
- scope is now the first argument passed into the $watch listener
this
in the $watch listener is undefined instead of current scope- objects and arrays are watched and compared by equality and not just identity
- the initial execution of the $watch listener now executes asynchronously with respect to the code registering it via $watch
- exceptionHandler argument is no more
- initRun argument is no more
- angular.scope does not create child scopes by taking parent as the first argument - use $new instead
- scope.$set and scope.$get were removed, use direct property assignment instead or $eval
- $route.onChange was removed and replaced with $beforeRouteChange, $afterRouteChange and $routeUpdate events that can be used together with the new $routeParams service
angular.equals()
now uses===
instead of==
when comparing primitives
- added error handling support for JSONP requests (see error callback param of the $xhr service) (commit)
- exposed http response headers in the $xhr and $resource callbacks (commit contributed by Karl Seamon)
- added
reloadOnSearch
$route param support to prevent unnecessary controller reloads and resulting flicker (commit)
- fixed memory leak found in ng:options directive (commit)
- make ng:class-even/odd compatible with ng:class (Issue #508)
- fixed error handling for resources that didn't work in certain situations (commit contributed by Karl Seamon)
- jsFiddle integration for all docs.angularjs.org examples (contributed by Dan Doyon).
- removed jqLite show/hide support. See the
commit
message for details. Developers should use jquery or jqLite's
css('display', 'none')
andcss('display', 'block'/'inline'/..)
instead
- ECMAScript 5 Strict Mode compliance
- jqLite
- added
show()
,hide()
andeq()
methods to jqlite (commit)
- added
- added $defer.cancel to support cancelation of tasks defered via the $defer service
- date filter
- added support for
full
,long
,medium
andshort
date-time format flags (commit) - added support for
z
flag, which stands for short string timezone identifier, e.g. PST - internal improvements to enable localization of date filter output
- added support for
- number filter
- internal improvements to enable localization of number filter output
- currency filter
- support for custom currency symbols via an optional param
- internal improvements to enable localization of number filter output
- added angular.version for exposing the version of the loaded angular.js file
- updated angular.js and angular.min.js file headers with angular version and shorter & updated license info
- ng:options
- $xhr and $resource support for per-request error callbacks (Issue #408) (contributed by Karl Seamon)
- make injector compatible with Rhino (HtmlUnit) (contributed by Mårten Dolk) commit
ie-compat.js
fixes and improvements related to fetching this file on the fly on legacy browsers- jqLite
- improved implementation of ng:show and ng:hide directives by using jqLite/jQuery hide and show methods
- ng:options
- fix incorrect re-growing of options on datasource change (Issue #464)
- added full offline support for docs (click on the link in the footer of docs.angularjs.org)
- many content improvements and corrections across all docs (reference api, tutorial, dev guide)
- many small design improvements
- doubled our e2e test suite by running all angular e2e tests with jqLite in addition to jQuery
- commit
removed support for the
MMMMM
(long month name), useMMMM
instead. This was done to align Angular with Unicode Technical Standard #35 used by Closure, as well as, future DOM apis currently being proposed to w3c. $xhr.error
'srequest
argument has nocallback
property anymore, usesuccess
instead
- New ng:options directive to better bind a model to
<select>
and<option>
elements. - New ng:disabled, ng:selected, ng:checked, ng:multiple and ng:readonly directives.
- Added support for string representation of month and day in date filter.
- Added support for
prepend()
to jqLite. - Added support for configurable HTTP header defaults for the $xhr service.
- Number filter would return incorrect value when fractional part had leading zeros.
- Issue #338: Show error when template with with multiple DOM roots is being compiled.
- Issue #399: return unsorted array if no predicate.
- Fixed issues with incorrect value of $position in ng:repeat when collection size changes.
- Fixed JSONP support in $xhr which didn't work without jquery since v0.9.13.
- various small fixes and improvements
- $service now has $service.invoke for method injection ($service(self, fn) no longer works)
- injection name inference no longer supports method curry and linking functions. Both must be explicitly specified using $inject property.
- Dynamic iteration (ng:repeat) on
<option>
elements is no longer supported. Use ng:options - Removal of index formatter (
ng:format="index"
) since its only use was with repeated<options>
(see above). - Calling $orderBy without a predicate now returns the original unsorted array, instead of ordering by natural order.
- JsTD Scenario Adapter for running scenario tests with jstd (from command line and in multiple browsers)
- brand new template for http://docs.angularjs.org/
- brand new tutorial that describes how to build a typical angular app http://docs.angularjs.org/#!/tutorial
- lots of new content for the dev guide (still work in progress) http://docs.angularjs.org/#!/guide
- ng:href produces unclickable links on IE7 #352
- IE 8 in compatibility mode breaks routing #353
- IE translates a 204 response code to 1223 #357
- Fixed unit test in IE7 #360
- Fixed unit tests on FF4, Opera #364
- Fixed opera date.toISOString issue #367
- html scenario runner requires ng:autotest script attribute to start tests automatically (example)
- IE9 support
- reverted ng:view sync cache fix due to regression in the order of initialization of parent and child controllers. (commits 9bd2c396 and 3d388498)
- $resource success callback is now executed whenever the http status code is
<200,300>
- fixed intentation code that caused some of the snippets on docs.angularjs.org to be mangled.
- many small improvements of the api docs.
- ng:repeat grows (adds children) significantly faster. (commit 15ec78f5)
- $xhr.cache optionally executes callbacks synchronously. (commit c06c5a36)
- ng:view and ng:include use sync $xhr.cache
- Fixed $resource encoding of query params. (commits e1d122a4, 78a0f410)
- code cleanup
- better minification (min is now 2.5% or almost 1kb smaller)
- minor documentation fixes
- JsTestDriver 1.3.2 upgrade with fixed coverage support
- Added XSRF protection for the $xhr service. (commit c578f8c3)
- Targeted auto-bootstrap – ng:autobind now takes an optional value which specifies an element id to be compiled instead of compiling the entire html document. (commit 9d5c5337)
- Fixed IE7 regression which prevented angular from bootstrapping in this browser.
- Cookies which contain unescaped '=' are now visible via the $cookies service. (commit 26bad2bf)
- $xhr service now executes "success" callback for all 2xx responses, not just 200. (commit 5343deb3)
- Always remove the script tag after successful JSONP request. (commit 0084cb5c)
- Removal of all
document.write
statements to make angular compabile with async script loaders. (commit 3224862a)
- The
post
parameter of [$browser.xhr][$browser] is now non-optional. Since everyone should be using the $xhr service instead of $browser.xhr, this should not break anyone. If you do use $browser.xhr then just add null for the post value argument where post was not passed in.
- Added a delay parameter to the $defer service. (commit edbe9d8c)
- Added
scope()
method to angular.element (jQuery) instances to retrieve a scope associated with a given DOM element. (commit 0a5c00ab) - Added inference of DI dependencies from function signature. This feature is experimental, check out dependency injection docs. (commit 7d4aee31)
- Angular now correctly recognizes and uses jQuery even if it was loaded after angular's script. More info at angular.element. (commit a004d487)
- All built-in angular services are now lazy-loaded. (commit a070ff5a)
- To make styling of custom html tags created via widgets and directives
easier, all of these elements now contain a css class with name in form of
<namespace>-<directive/widget name>
, e.g.<ng:include class="ng-include">
. (commit c7998f5f) - $xhr service now automatically detects and strips google-style JSON security prefix from http responses. (commit cd139f57)
- Rewrite of JQuery lite implementation for better supports operations on multiple nodes when matched by a selector and remove other bugs. (commit 00cc9eb3)
- Corrected an issue where properties inherited from __proto__ show up in ng:repeat. (commit 9e67da42)
- Fixed url encoding issue affecting $resource service. (commits e9ce2259 + 9e30baad)
- Removed
$eval()
call from the $cookies factory function, which was causing duplicate instances of singleton services to be created. (commit 65585a2d)
- New docs contribution guidelines.
- New description of release artifacts.
- Lots of improvements and other new content.
-
Removed the
$init()
method that used to be called after compilation of a template. This should affect only fraction of angular apps because the api was primarily being used by low level widgets tests.The old way of compiling the DOM element was angular.compile(element).$init(); The $init was there to allow the users to do any work to the scope before the view would be bound. This is a left over from not having proper MVC. The new recommended way to deal with initializing scope is to put it in the root constructor controller. To migrate simply remove the call to $init() and move any code you had before $init() to the root controller.
(commit 23b255a8)
-
Changed angular.compile API from
angular.compile(element[, scope])
toangular.compile(element)([scope], [cloneAttachFn])
(commits ef4bb28b + 945056b1) -
Removed ng:watch directives since it encourages logic in the UI. (commit 87cbf9f5)
- completed migration of docs from the wiki site to http://docs.angularjs.org/
- many, but by far not all, docs were updated, improved and cleaned up
- $route service now supports these features:
- route not found handling via
#otherwise()
- redirection support via
#when('/foo', {redirectTo: '/bar'})
(including param interpolation) - setting the parent scope for scopes created by the service via
#parent()
- reloading the current route via
#reload()
- route not found handling via
- added
angular.element(...).scope()
method to retrieve scope for a given element.
- value attribute gets clobbered when the element contains new line character(s).
- ng:view widget now works when nested inside an ng:include widget
- other various small fixes
- mock
$browser
now throws an exception if theflush()
method is called when there are no requests to be flushed. If you experienceNo xhr requests to be flushed!
errors in your tests, it's because you called$browser.xhr.flush()
unexpectedly. To make the error go away, either make sure your code makes a request via the$xhr
service or remove all unneededflush()
calls.
- new
ng:view
widget to simplify integration with the$route
service - the content of all standard HTML widgets is now being processed
(e.g.
<button>{{foo}}</button>
works now) (commit 1d7b9d56) - new
$log
and$exceptionHandler
service mocks now part ofangular-mocks.js
(commit f5d08963)
- (one/multiple) could not chose from a list of objects (commit 347be5ae) null and other falsy values should not be rendered in the view (issue #242) Docs rewrite of several major portions of angular.service., angular.Array., angular.Object.* docs added support for [sitemap]((http://docs.angularjs.org/sitemap.xml) to make the docs indexable by search crawlers transition of Developer Guide docs from the wiki into docs.angularjs.org lots of improvements related to formatting of the content of docs.anguarjs.org 0.9.9 time-shift (2011-01-13) Security Added a just in case security check for JSON parsing. (commit 5f080193) Completed security review with the Google Security Team. Performance $location and $cookies services are now lazily initialized to avoid the polling overhead when not needed. $location service now listens for onhashchange events (if supported by browser) instead of constant polling. (commit 16086aa3) input widgets known listens on keydown events instead of keyup which improves perceived performance (commit 47c454a3) angular boots significantly sooner by listening for DOMContentLoaded event instead of window.load when supported by browser (commit c79aba92) new service $updateView which may be used in favor of $root.$eval() to run a complete eval on the entire document. This service bulks and throttles DOM updates to improve performance. (commit 47c454a3) Docs Major improvements to the doc parser (commit 4f22d686) Docs now offline enabled (all dependencies are bundled in the tarball) (commit 4f5d5029) Added support for navigating the docs app with keyboard shortcuts (tab and ctrl+alt+s) Bugfixes angular.Object.equals now properly handless comparing an object with a null (commit b0be87f6) Several issues were addressed in the $location service (commit 23875cb3) angular.filter.date now properly handles some corner-cases (issue #159 - fix contributed by Vojta) Breaking changes API for accessing registered services — scope.$inject — was renamed to scope.$service. (commit b2631f61) Support for eager-published services was removed. This change was done to make explicit dependency declaration always required in order to allow making relatively expensive services lazily initialized (e.g. $cookie, $location), as well as remove 'magic' and reduce unnecessary scope namespace pollution. (commit 3ea5941f) Complete list of affected services: $location $route $cookies $window $document $exceptionHandler $invalidWidgets To temporarily preserve the 'eager-published' status for these services, you may use ng:init (e.g. ng:init="$location = $service('$location'), ...) in the view or more correctly create a service like this: angular.service('published-svc-shim', function($location, $route, $cookies, $window, $document, $exceptionHandler, $invalidWidgets) { this.$location = $location; this.$route = $route; this.$cookies = $cookies; this.$window = $window; this.$document = $document; this.$exceptionHandler = $exceptionHandler; this.$invalidWidgets = $invalidWidgets; }, {$inject: ['$location', '$route', '$cookies', '$window', '$document', '$exceptionHandler', '$invalidWidgets'], $eager: true}); In the light of the eager-published change, to complete the cleanup we renamed $creation property of services to $eager with its value being a boolean. To transition, please rename all $creation: 'eager' declarations to $eager: true. (commit 1430c6d6) angular.foreach was renamed to angular.forEach to make the api consistent. (commit 0a6cf70d) The toString method of the angular.service.$location service was removed. (commit 23875cb3) 0.9.8 astral-projection (2010-12-23) Docs/Getting started angular-seed project to get you hacking on an angular apps quickly https://github.com/angular/angular-seed Performance Delegate JSON parsing to native parser (JSON.parse) if available Bug Fixes Ignore input widgets which have no name (issue #153) 0.9.7 sonic-scream (2010-12-10) Bug Fixes $defer service should always call $eval on the root scope after a callback runs (issue #189) fix for failed assignments of form obj[0].name=value (issue #169) significant parser improvements that resulted in lower memory usage (commit 23fc73081feb640164615930b36ef185c23a3526) Docs small docs improvements (mainly docs for the $resource service) Breaking changes Angular expressions in the view used to support regular expressions. This feature was rarely used and added unnecessary complexity. It not a good idea to have regexps in the view anyway, so we removed this support. If you had any regexp in your views, you will have to move them to your controllers. (commit e5e69d9b90850eb653883f52c76e28dd870ee067) 0.9.6 night-vision (2010-12-06) Security several improvements in the HTML sanitizer code to prevent code execution via hrefs and other attributes. Commits: 41d5938883a3d06ffe8a88a51efd8d1896f7d747 2bbced212e2ee93948c45360fee00b2e3f960392 Docs set up http://docs.angularjs.org domain, the docs for the latest release will from now on be deployed here. docs app UI polishing with dual scrolling and other improvements Bug Fixes select widget now behaves correctly when it's option items are created via ng:repeat (issue #170) fix for async xhr cache issue #152 by adding $browser.defer and $defer service Breaking Changes Fix for issue #152 might break some tests that were relying on the incorrect behavior. The breakage will usually affect code that tests resources, xhr or services/widgets build on top of these. All that is typically needed to resolve the issue is adding a call to $browser.defer.flush() in your test just before the point where you expect all cached resource/xhr requests to return any results. Please see 011fa39c2a0b5da843395b538fc4e52e5ade8287 for more info. The HTML sanitizer is slightly more strinct now. Please see info in the "Security" section above. 0.9.5 turkey-blast (2010-11-25) Docs 99% of the content from the angular wiki is now in the docs Api added angular.Array.limitTo to make it easy to select first or last few items of an array 0.9.4 total-recall (2010-11-18) Docs searchable docs UI improvements we now have ~85% of the wiki docs migrated to ng docs some but not all docs were updated along the way Api ng:include now supports onload attribute (commit cc749760) Misc Better error handling - compilation exception now contain stack trace (commit b2d63ac4) 0.9.3 cold-resistance (2010-11-10) Docs prettier docs app with syntax highlighting for examples, etc added documentation, examples and scenario tests for many more apis including: all directives all formatters all validators some widgets Api date filter now accepts strings that angular.String.toDate can convert to Date objects angular.String.toDate supports ISO8061 formated strings with all time fractions being optional ng:repeat now exposes $position with values set to 'first', 'middle' or 'last' ng:switch now supports ng:switch-default as fallback switch option Breaking changes we now support ISO 8601 extended format datetime strings (YYYY-MM-DDTHH:mm:ss.SSSZ) as defined in EcmaScript 5 throughout angular. This means that the following apis switched from YYYY-MM-DDTHH:mm:ssZ to YYYY-MM-DDTHH:mm:ss.SSSZ (note the added millis) when representing dates: angular.Date.toString angular.String.fromDate JSON serialization and deserialization (used by json filter, $xhr and $resource) removed SSN validator. It's unlikely that most people will need it and if they do, it can be added simple RegExp validator. 0.9.2 faunal-mimicry (2010-11-03) Docs created documentation framework based on jsdoc syntax (commit 659af29a) jsdoc parser template generator json generator angular doc viewer app scenario runner for all example code documentation for all angular filters (commits 1fe7e3a1 & 1ba8c2a33) docs example code scenario tests for example code Testability Scenario Runner binding DSL in Scenario can now match bindings without specifying filters dsl statements now accept a label argument to make test output more readable (issue #94) dsl element() statement now implements most of the jQuery API (issue #106) new browser() dsl statement for getting info about the emulated browser running the app (issue #109) scenario runner is now compatible with IE8 (issue #93) scenarior runner checks if URL would return a non-success status code (issue #100) binding() DSL now accepts regular expressions new textarea() scenario runner DSL for entering text into textareas Misc lots of small bugfixes Breaking changes Scenario Runner navigating to about:blank is no longer supported. It results in a sandbox error navigateTo() is now browser().navigateTo(). Old code must be updated file:// URLs are no longer supported for running a scenario. You must use a web server that implements HEAD 0.9.1 repulsion-field (2010-10-26) Security added html sanitizer to fix the last few known security issues (issues #33 and #34) API new ng:submit directive for creating onSubmit handlers on forms (issue #76) the date filter now accepts milliseconds as well as date strings (issue #78) the html filter now supports 'unsafe' option to bypass html sanitization Testability lots of improvements related to the scenario runner (commit 40d7e66f) Demo added a new demo application: Personal Log (src example/personalLog) Chores lots of fixes to get all tests pass on IE added TzDate type to allow us to create timezone idependent tests (issue #88) Breaking changes $cookieStore service is not globally published any more, if you use it, you must request it via $inject as any other non-global service html filter now sanitizes html content for XSS attacks which may result in different behavior 0.9.0 dragon-breath (2010-10-20) Security angular.fromJson not safer (issue #57) readString consumes invalid escapes (issue #56) use new Function instead of eval (issue #52) Speed css cleanup + inline all css and images in the main js (issue #64) Testability initial version of the built-in end-to-end scenario runner (issues #50, #67, #70) API allow ng:controller nesting (issue #39) new built-in date format filter (issue #45) $location needs method you call on updates (issue #32) Chores release versioning + file renaming (issue #69) Breaking changes $location.parse was replaced with $location.update all css and img files were inlined into the main js file, to support IE7 and older app must host angular-ie-compat.js file Big Thanks to Our Community Contributors Vojta Jina