packaged angular-resource
This repo is for distribution on npm
and bower
. The source for this module is in the
main AngularJS repo.
Please file issues and pull requests against that repo.
Install
You can install this package either with npm
or with bower
.
npm
npm install angular-resource
Then add ngResource
as a dependency for your app:
angular.module('myApp', [require('angular-resource')]);
bower
bower install angular-resource
Add a <script>
to your index.html
:
<script src="/bower_components/angular-resource/angular-resource.js"></script>
Then add ngResource
as a dependency for your app:
angular.module('myApp', ['ngResource']);
Documentation
Documentation is available on the
AngularJS docs site.
License
The MIT License
Copyright (c) 2010-2015 Google, Inc. http://angularjs.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
1.5.0-beta.2 effective-delegation (2015-11-17)
Bug Fixes
- $animate: ensure leave animation calls
close
callback
(bfad2a4f,
#12278, #12096, #13054) - $cacheFactory: check key exists before decreasing cache size count
(b9bed7d9,
#12321, #12329)
- $compile:
- $http: apply
transformResponse
even when data
is empty
(7c0731ed,
#12976, #12979) - $location: ensure
$locationChangeSuccess
fires even if URL ends with #
(4412fe23,
#12175, #13251) - $parse: evaluate simple expressions in interpolations only once
(1caf0b6b,
#12983, #13002)
- $resource: allow XHR request to be cancelled via a timeout promise
(4fc73466,
#12657, #12675, #10890, #9332)
- $rootScope: prevent IE9 memory leak when destroying scopes
(8fe781fb,
#10706, #11786)
- Angular.js: fix
isArrayLike
for unusual cases
(2c8d87e0,
#10186, #8000, #4855, #4751, #10272) - isArrayLike: handle jQuery objects of length 0
(773efd08)
- jqLite:
- limitTo: start at 0 if
begin
is negative and exceeds input length
(ecf93048,
#12775, #12781) - merge:
- ensure that jqlite->jqlite and DOM->DOM
(75292a6c)
- clone elements instead of treating them like simple objects
(17715fa3,
#12286)
- ngAria: don't add tabindex to radio and checkbox inputs
(662fb282,
#12492, #13095)
- ngInput: change URL_REGEXP to better match RFC3987
(ffb6b2fb,
#11341, #11381)
- ngMessage: make ngMessage compatible with ngBind
(4971ef12,
#8089, #13074)
- ngMock: reset cache before every test
(fd83d372,
#13013)
- ngOptions:
- orderByFilter: throw error if input is not array-like
(2a85a634,
#11255, #11719)
Features
- $compile: multiple transclusion via named slots
(a4ada8ba,
#4357, #12742, #11736, #12934)
- $injector: allow specifying a decorator on $injector
(29a05984)
- $templateRequest: support configuration of $http options
(b2fc39d2,
#13188, #11868, #6860)
- Module: add helper method,
component(...)
for creating component directives
(54e81655,
#10007, #12933) - linky: add support for custom attributes
(06f002b1,
#12558, #13061)
- ngAnimate: introduce ngAnimateSwap directive
(78297d25)
- ngMock:
- add expectRoute and whenRoute shortcuts with colon param matching
(d67e999d,
#12406)
- invoke nested calls to
module()
immediately
(51a27c0f,
#12887)
Performance Improvements
- $compile: use static jquery data method to avoid creating new instances
(9b90c32f)
- $interpolate: provide a simplified result for constant expressions
(cf83b4f4)
- copy:
- avoid regex in
isTypedArray
(c8768d12) - only validate/clear if the user specifies a destination
(33c67ce7,
#12068)
- merge: remove unnecessary wrapping of jqLite element
(4daafd3d,
#13236)
Breaking Changes
ngMessage is now compiled with a priority of 1, which means directives
on the same element as ngMessage with a priority lower than 1 will
be applied when ngMessage calls the $transclude function.
Previously, they were applied during the initial compile phase and were
passed the comment element created by the transclusion of ngMessage.
To restore this behavior, custom directives need to have
their priority increased to at least "1".
Previously, an non array-like input would pass through the orderBy filter unchanged.
Now, an error is thrown. This can be worked around by converting an object
to an array, either manually or using a filter such as
https://github.com/petebacondarwin/angular-toArrayFilter.
(null
and undefined
still pass through without an error, in order to
support asynchronous loading of resources.)
<a name="1.5.0-beta.1"></a>