![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
angular-loader
Advanced tools
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.
You can install this package either with npm
or with bower
.
npm install angular-loader
Add a <script>
to your index.html
:
<script src="/node_modules/angular-loader/angular-loader.js"></script>
Note that this package is not in CommonJS format, so doing require('angular-loader')
will
return undefined
.
bower install angular-loader
Add a <script>
to your index.html
:
<script src="/bower_components/angular-loader/angular-loader.js"></script>
Documentation is available on the AngularJS docs site.
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.4.4 pylon-requirement (2015-08-13)
skipBlocking
avoids the pre-emptive transition-delay styling
(11695ca6)=
signs in values in parseKeyValue
(f13852c1,
#12351)$animateCss
(39b634e5,
#12509)The previous behavior involved ngAnimate having to wait for one
requestAnimationFrame before CSS classes were added/removed. The CSS classes
are now applied directly after the first digest that is triggered after
$animate.addClass
, $animate.removeClass
or $animate.setClass
is
called. If any of your code relies on waiting for one frame before
checking for CSS classes on the element then please change this
behavior. If a parent class-based animation, however, is run through a
JavaScript animation which triggers an animation for beforeAddClass
and/or beforeRemoveClass
then the CSS classes will not be applied
in time for the children (and the parent class-based animation will not
be cancelled by any child animations).
$timeout.flush()
to resolve a call to $q.when
with a value.The previous behavior involved creating an extra promise that needed to be resolved. This is no longer needed when
$q.when
is called with a value. In the case that the test is not aware if $q.when
is called with a value or
another promise, it is possible to replace $timeout.flush();
with $timeout.flush(0);
.
describe('$q.when', function() {
it('should not need a call to $timeout.flush() to resolve already resolved promises',
inject(function($q, $timeout) {
$q.when('foo');
// In AngularJS 1.4.3 a call to `$timeout.flush();` was needed
$timeout.verifyNoPendingTasks();
}));
it('should accept $timeout.flush(0) when not sure if $q.when was called with a value or a promise',
inject(function($q, $timeout) {
$q.when('foo');
$timeout.flush(0);
$timeout.verifyNoPendingTasks();
}));
it('should need a call to $timeout.flush() to resolve $q.when when called with a promise',
inject(function($q, $timeout) {
$q.when($q.when('foo'));
$timeout.flush();
$timeout.verifyNoPendingTasks();
}));
});
form: Due to 94533e57,
the name
attribute of form
elements can now only contain characters that can be evaluated as part
of an Angular expression. This is because Angular uses the value of name
as an assignable expression
to set the form on the $scope
. For example, name="myForm"
assigns the form to $scope.myForm
and
name="myObj.myForm"
assigns it to $scope.myObj.myForm
.
Previously, it was possible to also use names such name="my:name"
, because Angular used a special setter
function for the form name. Now the general, more robust $parse
setter is used.
The easiest way to migrate your code is therefore to remove all special characters from the name
attribute.
If you need to keep the special characters, you can use the following directive, which will replace
the name
with a value that can be evaluated as an expression in the compile function, and then
re-set the original name in the postLink function. This ensures that (1), the form is published on
the scope, and (2), the form has the original name, which might be important if you are doing server-side
form submission.
angular.module('myApp').directive('form', function() {
return {
restrict: 'E',
priority: 1000,
compile: function(element, attrs) {
var unsupportedCharacter = ':'; // change accordingly
var originalName = attrs.name;
if (attrs.name && attrs.name.indexOf(unsupportedCharacter) > 0) {
attrs.$set('name', 'this["' + originalName + '"]');
}
return postLinkFunction(scope, element) {
// Don't trigger $observers
element.setAttribute('name', originalName);
}
}
};
});
<a name="1.4.3"></a>
FAQs
AngularJS module for asynchronously loading modules
The npm package angular-loader receives a total of 4,826 weekly downloads. As such, angular-loader popularity was classified as popular.
We found that angular-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.