![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-2012 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.0-beta.0 photonic-umbrakinesis (2015-01-13)
fn
to be an optional parameter
(5a603023,
#9176)limitTo: due to a3c3bf33, limitTo changed behavior when limit value is invalid. Instead of returning empty object/array it returns unchanged input.
ngOptions: due to 7fda214c,
When using ngOptions
: the directive applies a surrogate key as the value of the <option>
element.
This commit changes the actual string used as the surrogate key. We now store a string that is computed
by calling hashKey
on the item in the options collection; previously it was the index or key of the
item in the collection.
(This is in keeping with the way that the unknown option value is represented in the select directive.)
Before you might have seen:
<select ng-model="x" ng-option="i in items">
<option value="1">a</option>
<option value="2">b</option>
<option value="3">c</option>
<option value="4">d</option>
</select>
Now it will be something like:
<select ng-model="x" ng-option="i in items">
<option value="string:a">a</option>
<option value="string:b">b</option>
<option value="string:c">c</option>
<option value="string:d">d</option>
</select>
If your application code relied on this value, which it shouldn't, then you will need to modify your
application to accommodate this. You may find that you can use the track by
feature of ngOptions
as this provides the ability to specify the key that is stored.
When iterating over an object's properties using the (key, value) in obj
syntax
the order of the elements used to be sorted alphabetically. This was an artificial
attempt to create a deterministic ordering since browsers don't guarantee the order.
But in practice this is not what people want and so this change iterates over properties
in the order they are returned by Object.keys(obj), which is almost always the order
in which the properties were defined.
setting the ngOptions attribute expression after the element is compiled, will no longer trigger the ngOptions behavior. This worked previously because the ngOptions logic was part of the select directive, while it is now implemented in the ngOptions directive itself.
the select
directive will now use strict comparison of the ngModel
scope value against option
values to determine which option is selected. This means Number
scope values will not be matched
against numeric option strings.
In AngularJS 1.3.x, setting scope.x = 200
would select the option
with the value 200 in the following select
:
<select ng-model="x">
<option value="100">100</option>
<option value="200">200</option>
</select>
In AngularJS 1.4.x, the 'unknown option' will be selected.
To remedy this, you can simply initialize the model as a string: scope.x = '200'
, or if you want to
keep the model as a Number
, you can do the conversion via $formatters
and $parsers
on ngModel
:
ngModelCtrl.$parsers.push(function(value) {
return parseInt(value, 10); // Convert option value to number
});
ngModelCtrl.$formatters.push(function(value) {
return value.toString(); // Convert scope value to string
});
<a name="1.3.9"></a>
FAQs
AngularJS module for asynchronously loading modules
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.