dist/ember.debug.js in ember-source-2.16.0.beta.1 vs dist/ember.debug.js in ember-source-2.16.0.beta.2
- old
+ new
@@ -4,11 +4,11 @@
* @copyright Copyright 2011-2017 Tilde Inc. and contributors
* Portions Copyright 2006-2011 Strobe Inc.
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
* @license Licensed under MIT license
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
- * @version 2.16.0-beta.1
+ * @version 2.16.0-beta.2
*/
var enifed, requireModule, Ember;
var mainContext = this; // Used in ember-environment/lib/global.js
@@ -9155,11 +9155,10 @@
this.targetQueues = Object.create(null);
this.index = 0;
this.name = name;
this.options = options;
this.globalOptions = globalOptions;
- this.globalOptions.onError = getOnError(globalOptions);
}
Queue.prototype.push = function push(target, method, args, stack) {
this._queue.push(target, method, args, stack);
return {
@@ -9190,12 +9189,10 @@
var target = void 0;
var method = void 0;
var args = void 0;
var errorRecordedForStack = void 0;
- var onError = this.globalOptions.onError;
- var invoke = onError ? this.invokeWithOnError : this.invoke;
this.targetQueues = Object.create(null);
var queueItems = void 0;
if (this._queueBeingFlushed.length > 0) {
queueItems = this._queueBeingFlushed;
} else {
@@ -9203,38 +9200,43 @@
this._queue = [];
}
if (before) {
before();
}
- for (var i = this.index; i < queueItems.length; i += 4) {
- this.index += 4;
- target = queueItems[i];
- method = queueItems[i + 1];
- args = queueItems[i + 2];
- errorRecordedForStack = queueItems[i + 3]; // Debugging assistance
- // method could have been nullified / canceled during flush
- if (method !== null) {
- //
- // ** Attention intrepid developer **
- //
- // To find out the stack of this task when it was scheduled onto
- // the run loop, add the following to your app.js:
- //
- // Ember.run.backburner.DEBUG = true; // NOTE: This slows your app, don't leave it on in production.
- //
- // Once that is in place, when you are at a breakpoint and navigate
- // here in the stack explorer, you can look at `errorRecordedForStack.stack`,
- // which will be the captured stack when this job was scheduled.
- //
- // One possible long-term solution is the following Chrome issue:
- // https://bugs.chromium.org/p/chromium/issues/detail?id=332624
- //
- invoke(target, method, args, onError, errorRecordedForStack);
+ var invoke = void 0;
+ if (queueItems.length > 0) {
+ var onError = getOnError(this.globalOptions);
+ invoke = onError ? this.invokeWithOnError : this.invoke;
+ for (var i = this.index; i < queueItems.length; i += 4) {
+ this.index += 4;
+ target = queueItems[i];
+ method = queueItems[i + 1];
+ args = queueItems[i + 2];
+ errorRecordedForStack = queueItems[i + 3]; // Debugging assistance
+ // method could have been nullified / canceled during flush
+ if (method !== null) {
+ //
+ // ** Attention intrepid developer **
+ //
+ // To find out the stack of this task when it was scheduled onto
+ // the run loop, add the following to your app.js:
+ //
+ // Ember.run.backburner.DEBUG = true; // NOTE: This slows your app, don't leave it on in production.
+ //
+ // Once that is in place, when you are at a breakpoint and navigate
+ // here in the stack explorer, you can look at `errorRecordedForStack.stack`,
+ // which will be the captured stack when this job was scheduled.
+ //
+ // One possible long-term solution is the following Chrome issue:
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=332624
+ //
+ invoke(target, method, args, onError, errorRecordedForStack);
+ }
+ if (this.index !== this._queueBeingFlushed.length && this.globalOptions.mustYield && this.globalOptions.mustYield()) {
+ return 1 /* Pause */;
+ }
}
- if (this.index !== this._queueBeingFlushed.length && this.globalOptions.mustYield && this.globalOptions.mustYield()) {
- return 1 /* Pause */;
- }
}
if (after) {
after();
}
this._queueBeingFlushed.length = 0;
@@ -9430,21 +9432,19 @@
return DeferredActionQueues;
}();
// accepts a function that when invoked will return an iterator
// iterator will drain until completion
- // accepts a function that when invoked will return an iterator
var iteratorDrain = function (fn) {
var iterator = fn();
var result = iterator.next();
while (result.done === false) {
result.value();
result = iterator.next();
}
};
- var now = Date.now;
var noop = function () {};
var Backburner = function () {
function Backburner(queueNames) {
var _this = this;
@@ -9481,10 +9481,13 @@
};
platform.next = _platform.next || function (fn) {
return platform.setTimeout(fn, 0);
};
platform.clearNext = _platform.clearNext || platform.clearTimeout;
+ platform.now = _platform.now || function () {
+ return Date.now();
+ };
this._platform = platform;
this._boundRunExpiredTimers = function () {
_this._runExpiredTimers();
};
this._boundAutorunEnd = function () {
@@ -9766,11 +9769,11 @@
} else {
method = args.shift();
}
}
var onError = getOnError(this.options);
- var executeAt = now() + wait;
+ var executeAt = this._platform.now() + wait;
var fn = void 0;
if (onError) {
fn = function () {
try {
method.apply(target, args);
@@ -9975,11 +9978,11 @@
Backburner.prototype._scheduleExpiredTimers = function _scheduleExpiredTimers() {
var timers = this._timers;
var l = timers.length;
var i = 0;
var defaultQueue = this.options.defaultQueue;
- var n = now();
+ var n = this._platform.now();
for (; i < l; i += 2) {
var executeAt = timers[i];
if (executeAt <= n) {
var fn = timers[i + 1];
this.schedule(defaultQueue, null, fn);
@@ -10007,11 +10010,11 @@
Backburner.prototype._installTimerTimeout = function _installTimerTimeout() {
if (this._timers.length === 0) {
return;
}
var minExpiresAt = this._timers[0];
- var n = now();
+ var n = this._platform.now();
var wait = Math.max(0, minExpiresAt - n);
this._timerTimeoutId = this._platform.setTimeout(this._boundRunExpiredTimers, wait);
};
Backburner.prototype._ensureInstance = function _ensureInstance() {
@@ -10029,11 +10032,11 @@
Backburner.Queue = Queue;
exports.default = Backburner;
});
-enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'ember/features', 'ember-environment'], function (exports, _emberBabel, _emberUtils, _emberDebug, _features) {
+enifed('container', ['exports', 'ember-babel', 'ember-utils', 'ember-debug', 'ember/features'], function (exports, _emberBabel, _emberUtils, _emberDebug, _features) {
'use strict';
exports.Container = exports.privatize = exports.Registry = undefined;
@@ -10411,11 +10414,11 @@
// owner, etc. without a double extend and without
// modifying the objects properties
if (typeof this.class._initFactory === 'function') {
this.class._initFactory(this);
} else {
- // in the non-Ember.Object case we need to still setOwner
+ // in the non-EmberObject case we need to still setOwner
// this is required for supporting glimmer environment and
// template instantiation which rely heavily on
// `options[OWNER]` being passed into `create`
// TODO: clean this up, and remove in future versions
(0, _emberUtils.setOwner)(props, this.owner);
@@ -12349,11 +12352,11 @@
@method getEngineParent
@param {EngineInstance} engine An engine instance.
@return {EngineInstance} The parent engine instance.
@for Ember
- @public
+ @private
*/
function getEngineParent(engine) {
return engine[ENGINE_PARENT];
}
@@ -12497,83 +12500,104 @@
`name`, `before`, `after`, `initialize`. The only required attribute is
`initialize`, all others are optional.
* `name` allows you to specify under which name the initializer is registered.
This must be a unique name, as trying to register two initializers with the
same name will result in an error.
- ```javascript
- Ember.Application.initializer({
- name: 'namedInitializer',
- initialize: function(application) {
- Ember.debug('Running namedInitializer!');
- }
- });
+ ```app/initializer/named-initializer.js
+ import { debug } from '@ember/debug';
+ export function initialize() {
+ debug('Running namedInitializer!');
+ }
+ export default {
+ name: 'named-initializer',
+ initialize
+ };
```
* `before` and `after` are used to ensure that this initializer is ran prior
or after the one identified by the value. This value can be a single string
or an array of strings, referencing the `name` of other initializers.
An example of ordering initializers, we create an initializer named `first`:
- ```javascript
- Ember.Application.initializer({
+ ```app/initializer/first.js
+ import { debug } from '@ember/debug';
+ export function initialize() {
+ debug('First initializer!');
+ }
+ export default {
name: 'first',
- initialize: function(application) {
- Ember.debug('First initializer!');
- }
- });
- // DEBUG: First initializer!
+ initialize
+ };
```
+ ```bash
+ // DEBUG: First initializer!
+ ```
We add another initializer named `second`, specifying that it should run
after the initializer named `first`:
- ```javascript
- Ember.Application.initializer({
+ ```app/initializer/second.js
+ import { debug } from '@ember/debug';
+ export function initialize() {
+ debug('Second initializer!');
+ }
+ export default {
name: 'second',
after: 'first',
- initialize: function(application) {
- Ember.debug('Second initializer!');
- }
- });
- // DEBUG: First initializer!
+ initialize
+ };
+ ```
+ ```
+ // DEBUG: First initializer!
// DEBUG: Second initializer!
```
Afterwards we add a further initializer named `pre`, this time specifying
that it should run before the initializer named `first`:
- ```javascript
- Ember.Application.initializer({
+ ```app/initializer/pre.js
+ import { debug } from '@ember/debug';
+ export function initialize() {
+ debug('Pre initializer!');
+ }
+ export default {
name: 'pre',
before: 'first',
- initialize: function(application) {
- Ember.debug('Pre initializer!');
- }
- });
- // DEBUG: Pre initializer!
+ initialize
+ };
+ ```
+ ```bash
+ // DEBUG: Pre initializer!
// DEBUG: First initializer!
// DEBUG: Second initializer!
```
Finally we add an initializer named `post`, specifying it should run after
both the `first` and the `second` initializers:
- ```javascript
- Ember.Application.initializer({
+ ```app/initializer/post.js
+ import { debug } from '@ember/debug';
+ export function initialize() {
+ debug('Post initializer!');
+ }
+ export default {
name: 'post',
after: ['first', 'second'],
- initialize: function(application) {
- Ember.debug('Post initializer!');
- }
- });
- // DEBUG: Pre initializer!
+ initialize
+ };
+ ```
+ ```bash
+ // DEBUG: Pre initializer!
// DEBUG: First initializer!
// DEBUG: Second initializer!
// DEBUG: Post initializer!
```
* `initialize` is a callback function that receives one argument,
`application`, on which you can operate.
Example of using `application` to register an adapter:
- ```javascript
- Ember.Application.initializer({
- name: 'api-adapter',
- initialize: function(application) {
- application.register('api-adapter:main', ApiAdapter);
- }
- });
+ ```app/initializer/api-adapter.js
+ import ApiAdapter from '../utils/api-adapter';
+ export function initialize(application) {
+ application.register('api-adapter:main', ApiAdapter);
+ }
+ export default {
+ name: 'post',
+ after: ['first', 'second'],
+ initialize
+ };
```
@method initializer
@param initializer {Object}
@public
*/
@@ -12589,47 +12613,50 @@
`name`, `before`, `after`, `initialize`. The only required attribute is
`initialize`, all others are optional.
* `name` allows you to specify under which name the instanceInitializer is
registered. This must be a unique name, as trying to register two
instanceInitializer with the same name will result in an error.
- ```javascript
- Ember.Application.instanceInitializer({
- name: 'namedinstanceInitializer',
- initialize: function(application) {
- Ember.debug('Running namedInitializer!');
- }
- });
+ ```app/initializer/named-instance-initializer.js
+ import { debug } from '@ember/debug';
+ export function initialize() {
+ debug('Running named-instance-initializer!');
+ }
+ export default {
+ name: 'named-instance-initializer',
+ initialize
+ };
```
* `before` and `after` are used to ensure that this initializer is ran prior
or after the one identified by the value. This value can be a single string
or an array of strings, referencing the `name` of other initializers.
* See Ember.Application.initializer for discussion on the usage of before
and after.
Example instanceInitializer to preload data into the store.
- ```javascript
- Ember.Application.initializer({
- name: 'preload-data',
- initialize: function(application) {
+ ```app/initializer/preload-data.js
+ import $ from 'jquery';
+ export function initialize(application) {
var userConfig, userConfigEncoded, store;
// We have a HTML escaped JSON representation of the user's basic
// configuration generated server side and stored in the DOM of the main
// index.html file. This allows the app to have access to a set of data
// without making any additional remote calls. Good for basic data that is
// needed for immediate rendering of the page. Keep in mind, this data,
// like all local models and data can be manipulated by the user, so it
// should not be relied upon for security or authorization.
- //
- // Grab the encoded data from the meta tag
- userConfigEncoded = Ember.$('head meta[name=app-user-config]').attr('content');
- // Unescape the text, then parse the resulting JSON into a real object
+ // Grab the encoded data from the meta tag
+ userConfigEncoded = $('head meta[name=app-user-config]').attr('content');
+ // Unescape the text, then parse the resulting JSON into a real object
userConfig = JSON.parse(unescape(userConfigEncoded));
- // Lookup the store
+ // Lookup the store
store = application.lookup('service:store');
- // Push the encoded JSON into the store
+ // Push the encoded JSON into the store
store.pushPayload(userConfig);
- }
- });
+ }
+ export default {
+ name: 'named-instance-initializer',
+ initialize
+ };
```
@method instanceInitializer
@param instanceInitializer
@public
*/
@@ -12653,11 +12680,11 @@
},
/**
Set this to provide an alternate class to `Ember.DefaultResolver`
- @deprecated Use 'Resolver' instead
+ @deprecated Use 'Resolver' instead
@property resolver
@public
*/
resolver: null,
@@ -12806,16 +12833,20 @@
The methods of this object are designed to be easy to override
in a subclass. For example, you could enhance how a template
is resolved like so:
- ```javascript
- App = Ember.Application.create({
- Resolver: Ember.DefaultResolver.extend({
- resolveTemplate: function(parsedName) {
+ ```app/app.js
+ import Application from '@ember/application';
+ import GlobalsResolver from '@ember/application/globals-resolver';
+
+ App = Application.create({
+ Resolver: GlobalsResolver.extend({
+ resolveTemplate(parsedName) {
let resolvedTemplate = this._super(parsedName);
if (resolvedTemplate) { return resolvedTemplate; }
+
return Ember.TEMPLATES['not_found'];
}
})
});
```
@@ -13109,14 +13140,14 @@
return (0, _emberMetal.get)(parsedName.root, className);
},
/**
- @method _logLookup
- @param {Boolean} found
- @param {Object} parsedName
- @private
+ @method _logLookup
+ @param {Boolean} found
+ @param {Object} parsedName
+ @private
*/
_logLookup: function (found, parsedName) {
var symbol = found ? '[✓]' : '[ ]';
var padding = void 0;
@@ -13129,15 +13160,15 @@
(0, _emberDebug.info)(symbol, parsedName.fullName, padding, this.lookupDescription(parsedName.fullName));
},
/**
- Used to iterate all items of a given type.
- @method knownForType
- @param {String} type the type to search for
- @private
- */
+ Used to iterate all items of a given type.
+ @method knownForType
+ @param {String} type the type to search for
+ @private
+ */
knownForType: function (type) {
var namespace = (0, _emberMetal.get)(this, 'namespace');
var suffix = _emberRuntime.String.classify(type);
var typeRegexp = new RegExp(suffix + '$');
@@ -13156,20 +13187,19 @@
return known;
},
/**
- Converts provided name from the backing namespace into a container lookup name.
- Examples:
- App.FooBarHelper -> helper:foo-bar
- App.THelper -> helper:t
- @method translateToContainerFullname
- @param {String} type
- @param {String} name
- @private
- */
-
+ Converts provided name from the backing namespace into a container lookup name.
+ Examples:
+ * App.FooBarHelper -> helper:foo-bar
+ * App.THelper -> helper:t
+ @method translateToContainerFullname
+ @param {String} type
+ @param {String} name
+ @private
+ */
translateToContainerFullname: function (type, name) {
var suffix = _emberRuntime.String.classify(type);
var namePrefix = name.slice(0, suffix.length * -1);
var dasherizedName = _emberRuntime.String.dasherize(namePrefix);
@@ -15962,13 +15992,13 @@
For example, you could implement the action
`hello` for the `person-profile` component:
```app/components/person-profile.js
- import Ember from 'ember';
+ import Component from '@ember/component';
- export default Ember.Component.extend({
+ export default Component.extend({
actions: {
hello(name) {
console.log("Hello", name);
}
}
@@ -15996,13 +16026,13 @@
The default HTML tag name used for a component's DOM representation is `div`.
This can be customized by setting the `tagName` property.
The following component class:
```app/components/emphasized-paragraph.js
- import Ember from 'ember';
+ import Component from '@ember/component';
- export default Ember.Component.extend({
+ export default Component.extend({
tagName: 'em'
});
```
Would result in instances with the following HTML:
@@ -16016,13 +16046,13 @@
The HTML `class` attribute of a component's tag can be set by providing a
`classNames` property that is set to an array of strings:
```app/components/my-widget.js
- import Ember from 'ember';
+ import Component from '@ember/component';
- export default Ember.Component.extend({
+ export default Component.extend({
classNames: ['my-class', 'my-other-class']
});
```
Will result in component instances with an HTML representation of:
@@ -16035,13 +16065,13 @@
property set to an array of properties names for the component. The return value
of these properties will be added as part of the value for the components's `class`
attribute. These properties can be computed properties:
```app/components/my-widget.js
- import Ember from 'ember';
+ import Component from '@ember/component';
- export default Ember.Component.extend({
+ export default Component.extend({
classNameBindings: ['propertyA', 'propertyB'],
propertyA: 'from-a',
propertyB: Ember.computed(function() {
if (someLogic) { return 'from-b'; }
})
@@ -16057,13 +16087,13 @@
If the value of a class name binding returns a boolean the property name
itself will be used as the class name if the property is true.
The class name will not be added if the value is `false` or `undefined`.
```app/components/my-widget.js
- import Ember from 'ember';
+ import Component from '@ember/component';
- export default Ember.Component.extend({
+ export default Component.extend({
classNameBindings: ['hovered'],
hovered: true
});
```
@@ -16076,13 +16106,13 @@
When using boolean class name bindings you can supply a string value other
than the property name for use as the `class` HTML attribute by appending the
preferred value after a ":" character when defining the binding:
```app/components/my-widget.js
- import Ember from 'ember';
+ import Component from '@ember/component';
- export default Ember.Component.extend({
+ export default Component.extend({
classNameBindings: ['awesome:so-very-cool'],
awesome: true
});
```
@@ -16094,13 +16124,13 @@
Boolean value class name bindings whose property names are in a
camelCase-style format will be converted to a dasherized format:
```app/components/my-widget.js
- import Ember from 'ember';
+ import Component from '@ember/component';
- export default Ember.Component.extend({
+ export default Component.extend({
classNameBindings: ['isUrgent'],
isUrgent: true
});
```
@@ -16112,13 +16142,13 @@
Class name bindings can also refer to object values that are found by
traversing a path relative to the component itself:
```app/components/my-widget.js
- import Ember from 'ember';
+ import Component from '@ember/component';
- export default Ember.Component.extend({
+ export default Component.extend({
classNameBindings: ['messages.empty'],
messages: Ember.Object.create({
empty: true
})
});
@@ -16133,13 +16163,13 @@
If you want to add a class name for a property which evaluates to true and
and a different class name if it evaluates to false, you can pass a binding
like this:
```app/components/my-widget.js
- import Ember from 'ember';
+ import Component from '@ember/component';
- export default Ember.Component.extend({
+ export default Component.extend({
classNameBindings: ['isEnabled:enabled:disabled'],
isEnabled: true
});
```
@@ -16157,14 +16187,14 @@
```
This syntax offers the convenience to add a class if a property is `false`:
```app/components/my-widget.js
- import Ember from 'ember';
+ import Component from '@ember/component';
// Applies no class when isEnabled is true and class 'disabled' when isEnabled is false
- export default Ember.Component.extend({
+ export default Component.extend({
classNameBindings: ['isEnabled::disabled'],
isEnabled: true
});
```
@@ -16196,13 +16226,13 @@
`attributeBindings` property set to an array of property names on the component.
The return value of these properties will be used as the value of the component's
HTML associated attribute:
```app/components/my-anchor.js
- import Ember from 'ember';
+ import Component from '@ember/component';
- export default Ember.Component.extend({
+ export default Component.extend({
tagName: 'a',
attributeBindings: ['href'],
href: 'http://google.com'
});
```
@@ -16215,13 +16245,13 @@
One property can be mapped on to another by placing a ":" between
the source property and the destination property:
```app/components/my-anchor.js
- import Ember from 'ember';
+ import Component from '@ember/component';
- export default Ember.Component.extend({
+ export default Component.extend({
tagName: 'a',
attributeBindings: ['url:href'],
url: 'http://google.com'
});
```
@@ -16234,13 +16264,13 @@
Namespaced attributes (e.g. `xlink:href`) are supported, but have to be
mapped, since `:` is not a valid character for properties in Javascript:
```app/components/my-use.js
- import Ember from 'ember';
+ import Component from '@ember/component';
- export default Ember.Component.extend({
+ export default Component.extend({
tagName: 'use',
attributeBindings: ['xlinkHref:xlink:href'],
xlinkHref: '#triangle'
});
```
@@ -16253,13 +16283,13 @@
If the return value of an `attributeBindings` monitored property is a boolean
the attribute will be present or absent depending on the value:
```app/components/my-text-input.js
- import Ember from 'ember';
+ import Component from '@ember/component';
- export default Ember.Component.extend({
+ export default Component.extend({
tagName: 'input',
attributeBindings: ['disabled'],
disabled: false
});
```
@@ -16271,13 +16301,13 @@
```
`attributeBindings` can refer to computed properties:
```app/components/my-text-input.js
- import Ember from 'ember';
+ import Component from '@ember/component';
- export default Ember.Component.extend({
+ export default Component.extend({
tagName: 'input',
attributeBindings: ['disabled'],
disabled: Ember.computed(function() {
if (someLogic) {
return true;
@@ -16290,13 +16320,13 @@
To prevent setting an attribute altogether, use `null` or `undefined` as the
return value of the `attributeBindings` monitored property:
```app/components/my-text-input.js
- import Ember from 'ember';
+ import Component from '@ember/component';
- export default Ember.Component.extend({
+ export default Component.extend({
tagName: 'form',
attributeBindings: ['novalidate'],
novalidate: null
});
```
@@ -16320,14 +16350,14 @@
<h1>Person's Title</h1>
<div class='details'>{{yield}}</div>
```
```app/components/person-profile.js
- import Ember from 'ember';
+ import Component from '@ember/component';
import layout from '../templates/components/person-profile';
- export default Ember.Component.extend({
+ export default Component.extend({
layout
});
```
The above will result in the following HTML output:
@@ -16353,13 +16383,13 @@
Components can respond to user-initiated events by implementing a method that
matches the event name. A `jQuery.Event` object will be passed as the
argument to this method.
```app/components/my-widget.js
- import Ember from 'ember';
+ import Component from '@ember/component';
- export default Ember.Component.extend({
+ export default Component.extend({
click(event) {
// will be called when an instance's
// rendered element is clicked
}
});
@@ -17260,17 +17290,17 @@
When transitioning into the linked route, the `model` hook will
be triggered with parameters including this passed identifier.
### Allowing Default Action
- By default the `{{link-to}}` component prevents the default browser action
- by calling `preventDefault()` as this sort of action bubbling is normally
- handled internally and we do not want to take the browser to a new URL (for
- example).
+ By default the `{{link-to}}` component prevents the default browser action
+ by calling `preventDefault()` as this sort of action bubbling is normally
+ handled internally and we do not want to take the browser to a new URL (for
+ example).
- If you need to override this behavior specify `preventDefault=false` in
- your template:
+ If you need to override this behavior specify `preventDefault=false` in
+ your template:
```handlebars
{{#link-to 'photoGallery' aPhotoId preventDefault=false}}
{{aPhotoId.title}}
{{/link-to}}
@@ -17400,11 +17430,12 @@
*/
exports.default = _component.default.extend(_emberViews.TextSupport, {
layout: _empty.default,
classNames: ['ember-text-field'],
tagName: 'input',
- attributeBindings: ['accept', 'autocomplete', 'autosave', 'dir', 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget', 'height', 'inputmode', 'lang', 'list', 'max', 'min', 'multiple', 'name', 'pattern', 'size', 'step', 'type', 'value', 'width'],
+ attributeBindings: ['accept', 'autocomplete', 'autosave', 'dir', 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget', 'height', 'inputmode', 'lang', 'list', 'type', // needs to be before min and max. See #15675
+ 'max', 'min', 'multiple', 'name', 'pattern', 'size', 'step', 'value', 'width'],
/**
The `value` attribute of the input element. As the user inputs text, this
property is updated live.
@property value
@@ -17861,12 +17892,14 @@
{{show-money amount=(format-currency cents currency="$")}}
```
Helpers defined using a class must provide a `compute` function. For example:
- ```js
- export default Ember.Helper.extend({
+ ```app/helpers/format-currency.js
+ import Helper from '@ember/component/helper';
+
+ export default Helper.extend({
compute(params, hash) {
let cents = params[0];
let currency = hash.currency;
return `${currency}${cents * 0.01}`;
}
@@ -17919,13 +17952,14 @@
/**
In many cases, the ceremony of a full `Ember.Helper` class is not required.
The `helper` method create pure-function helpers without instances. For
example:
- ```js
- // app/helpers/format-currency.js
- export default Ember.Helper.helper(function(params, hash) {
+ ```app/helpers/format-currency.js
+ import { helper } from '@ember/component/helper';
+
+ export default helper(function(params, hash) {
let cents = params[0];
let currency = hash.currency;
return `${currency}${cents * 0.01}`;
});
```
@@ -18130,14 +18164,14 @@
Because the `actionFunction` is just a function, closure actions can be
passed between components and still execute in the correct context.
Here is an example action handler on a component:
- ```js
- import Ember from 'ember';
+ ```app/components/my-component.js
+ import Component from '@ember/component';
- export default Ember.Component.extend({
+ export default Component.extend({
actions: {
save() {
this.get('model').save();
}
}
@@ -18162,12 +18196,14 @@
Actions should be invoked using the [sendAction](/api/classes/Ember.Component.html#method_sendAction)
method. The first argument to `sendAction` is the action to be called, and
additional arguments are passed to the action function. This has interesting
properties combined with currying of arguments. For example:
- ```js
- export default Ember.Component.extend({
+ ```app/components/my-component.js
+ import Component from '@ember/component';
+
+ export default Component.extend({
actions: {
// Usage {{input on-input=(action (action 'setName' model) value="target.value")}}
setName(model, name) {
model.set('name', name);
}
@@ -18182,13 +18218,13 @@
Actions invoked with `sendAction` have the same currying behavior as demonstrated
with `on-input` above. For example:
```app/components/my-input.js
- import Ember from 'ember';
+ import Component from '@ember/component';
- export default Ember.Component.extend({
+ export default Component.extend({
actions: {
setName(model, name) {
model.set('name', name);
}
}
@@ -18198,13 +18234,13 @@
```handlebars
{{my-input submit=(action 'setName' model)}}
```
```app/components/my-component.js
- import Ember from 'ember';
+ import Component from '@ember/component';
- export default Ember.Component.extend({
+ export default Component.extend({
click() {
// Note that model is not passed, it was curried in the template
this.sendAction('submit', 'bob');
}
});
@@ -18256,19 +18292,19 @@
```handlebars
<div onclick={{disable-bubbling (action "sayHello")}}>Hello</div>
```
```app/helpers/disable-bubbling.js
- import Ember from 'ember';
+ import { helper } from '@ember/component/helper';
export function disableBubbling([action]) {
return function(event) {
event.stopPropagation();
return action(event);
};
}
- export default Ember.Helper.helper(disableBubbling);
+ export default helper(disableBubbling);
```
If you need the default handler to trigger you should either register your
own event handler, or use event methods on your view class. See
["Responding to Browser Events"](/api/classes/Ember.Component#responding-to-browser-events)
@@ -18321,14 +18357,15 @@
click me
</div>
```
```app/controllers/application.js
- import Ember from 'ember';
+ import Controller from '@ember/controller';
+ import { inject as service } from '@ember/service';
- export default Ember.Controller.extend({
- someService: Ember.inject.service()
+ export default Controller.extend({
+ someService: service()
});
```
@method action
@for Ember.Templates.helpers
@@ -18771,11 +18808,11 @@
var path = this.lastPath = this.pathReference.value();
if (path !== lastPath) {
- if (path) {
+ if (path !== undefined && path !== null) {
var pathType = typeof path;
if (pathType === 'string') {
innerReference = this.innerReference = (0, _reference.referenceFromParts)(this.sourceReference, path.split('.'));
} else if (pathType === 'number') {
@@ -20627,14 +20664,35 @@
```handlebars
{{! application.hbs }}
{{mount "ember-chat"}}
```
- Currently, the engine name is the only argument that can be passed to
- `{{mount}}`.
+ Additionally, you can also pass in a `model` argument that will be
+ set as the engines model. This can be an existing object:
+
+ ```
+ <div>
+ {{mount 'admin' model=userSettings}}
+ </div>
+ ```
+ Or an inline `hash`, and you can even pass components:
+
+ ```
+ <div>
+ <h1>Application template!</h1>
+ {{mount 'admin' model=(hash
+ title='Secret Admin'
+ signInButton=(component 'sign-in-button')
+ )}}
+ </div>
+ ```
+
@method mount
+ @param {String} name Name of the engine to mount.
+ @param {Object} [model] Object that will be set as
+ the model of the engine.
@for Ember.Templates.helpers
@category ember-application-engines
@public
*/
function mountMacro(name, params, hash, builder) {
@@ -20803,13 +20861,14 @@
```
Your routes can then render into a specific one of these `outlet`s by specifying the `outlet`
attribute in your `renderTemplate` function:
- ```javascript
- // app/routes/menu.js
- export default Ember.Route.extend({
+ ```app/routes/menu.js
+ import Route from '@ember/routing/route';
+
+ export default Route.extend({
renderTemplate() {
this.render({ outlet: 'menu' });
}
});
```
@@ -20889,12 +20948,14 @@
Note: A given controller may only be used *once* in your app in this manner.
A singleton instance of the controller will be created for you.
Example:
- ```javascript
- App.NavigationController = Ember.Controller.extend({
+ ```app/controllers/navigation.js
+ import Controller from '@ember/controller';
+
+ export default Controller.extend({
who: "world"
});
```
```handlebars
@@ -22993,11 +23054,11 @@
@param obj
@param {String} eventName
*/
function hasListeners(obj, eventName) {
var meta$$1 = exports.peekMeta(obj);
- if (!meta$$1) {
+ if (meta$$1 === undefined) {
return false;
}
var matched = meta$$1.matchingListeners(eventName);
return matched !== undefined && matched.length > 0;
}
@@ -23056,10 +23117,18 @@
args[_key] = arguments[_key];
}
var func = args.pop();
var events = args;
+
+ true && !(typeof func === 'function') && emberDebug.assert('Ember.on expects function as last argument', typeof func === 'function');
+ true && !(events.length > 0 && events.every(function (p) {
+ return typeof p === 'string' && p.length;
+ })) && emberDebug.assert('Ember.on called without valid event names', events.length > 0 && events.every(function (p) {
+ return typeof p === 'string' && p.length;
+ }));
+
func.__ember_listens__ = events;
return func;
}
var hasViews = function () {
@@ -23658,21 +23727,21 @@
}
function DEFAULT_GETTER_FUNCTION(name) {
return function GETTER_FUNCTION() {
var meta$$1 = exports.peekMeta(this);
- if (meta$$1 !== null && meta$$1 !== undefined) {
+ if (meta$$1 !== undefined) {
return meta$$1.peekValues(name);
}
};
}
function INHERITING_GETTER_FUNCTION(name) {
function IGETTER_FUNCTION() {
var meta$$1 = exports.peekMeta(this);
var val = void 0;
- if (meta$$1 !== null && meta$$1 !== undefined) {
+ if (meta$$1 !== undefined) {
val = meta$$1.readInheritedValue('values', name);
}
if (val === UNDEFINED) {
var proto = Object.getPrototypeOf(this);
@@ -23730,11 +23799,11 @@
You must provide this or `data` but not both.
@param {*} [data] something other than a descriptor, that will
become the explicit value of this property.
*/
function defineProperty(obj, keyName, desc, data, meta$$1) {
- if (meta$$1 === null || meta$$1 === undefined) {
+ if (meta$$1 === undefined) {
meta$$1 = meta(obj);
}
var watchEntry = meta$$1.peekWatching(keyName);
var watching = watchEntry !== undefined && watchEntry > 0;
@@ -23918,11 +23987,11 @@
return;
}
var meta$$1 = _meta || exports.peekMeta(obj);
// do nothing of this object has already been destroyed
- if (!meta$$1 || meta$$1.isSourceDestroyed()) {
+ if (meta$$1 === undefined || meta$$1.isSourceDestroyed()) {
return;
}
var count = meta$$1.peekWatching(keyName);
if (count === 1) {
@@ -24129,13 +24198,13 @@
function removeChainWatcher(obj, keyName, node, _meta) {
if (!isObject(obj)) {
return;
}
- var meta$$1 = _meta || exports.peekMeta(obj);
+ var meta$$1 = _meta === undefined ? exports.peekMeta(obj) : _meta;
- if (!meta$$1 || !meta$$1.readableChainWatchers()) {
+ if (meta$$1 === undefined || meta$$1.readableChainWatchers() === undefined) {
return;
}
// make meta writable
meta$$1 = meta(obj);
@@ -25592,11 +25661,12 @@
@namespace Ember
@public
*/
function ComputedProperty(config, opts) {
this.isDescriptor = true;
- if (typeof config === 'function') {
+ var hasGetterOnly = typeof config === 'function';
+ if (hasGetterOnly) {
this._getter = config;
} else {
true && !(typeof config === 'object' && !Array.isArray(config)) && emberDebug.assert('Ember.computed expects a function or an object as last argument.', typeof config === 'object' && !Array.isArray(config));
true && !Object.keys(config).every(function (key) {
return key === 'get' || key === 'set';
@@ -25610,12 +25680,13 @@
true && !(!!this._getter || !!this._setter) && emberDebug.assert('Computed properties must receive a getter or a setter, you passed none.', !!this._getter || !!this._setter);
this._suspended = undefined;
this._meta = undefined;
this._volatile = false;
+
this._dependentKeys = opts && opts.dependentKeys;
- this._readOnly = false;
+ this._readOnly = opts && hasGetterOnly && opts.readOnly === true;
}
ComputedProperty.prototype = new Descriptor();
ComputedProperty.prototype.constructor = ComputedProperty;
@@ -25729,14 +25800,17 @@
available for introspection.
You can pass a hash of these values to a computed property like this:
```
- person: Ember.computed(function() {
+ import { computed } from '@ember/object';
+ import Person from 'my-app/utils/person';
+
+ person: computed(function() {
let personId = this.get('personId');
- return App.Person.create({ id: personId });
- }).meta({ type: App.Person })
+ return Person.create({ id: personId });
+ }).meta({ type: Person })
```
The hash that you pass to the `meta()` function will be saved on the
computed property descriptor under the `_meta` key. Ember runtime
exposes a public API for retrieving these values from classes,
@@ -25764,16 +25838,16 @@
return;
}
// don't create objects just to invalidate
var meta$$1 = exports.peekMeta(obj);
- if (!meta$$1 || meta$$1.source !== obj) {
+ if (meta$$1 === undefined || meta$$1.source !== obj) {
return;
}
var cache = meta$$1.readableCache();
- if (cache && cache[keyName] !== undefined) {
+ if (cache !== undefined && cache[keyName] !== undefined) {
cache[keyName] = undefined;
removeDependentKeys(this, obj, keyName, meta$$1);
}
};
@@ -25791,18 +25865,14 @@
} else if (result !== undefined) {
return result;
}
var ret = this._getter.call(obj, keyName);
- if (ret === undefined) {
- cache[keyName] = UNDEFINED;
- } else {
- cache[keyName] = ret;
- }
+ cache[keyName] = ret === undefined ? UNDEFINED : ret;
var chainWatchers = meta$$1.readableChainWatchers();
- if (chainWatchers) {
+ if (chainWatchers !== undefined) {
chainWatchers.revalidate(keyName);
}
addDependentKeys(this, obj, keyName, meta$$1);
return ret;
@@ -25848,19 +25918,18 @@
this._suspended = oldSuspended;
}
};
ComputedPropertyPrototype._set = function computedPropertySet(obj, keyName, value) {
- // cache requires own meta
var meta$$1 = meta(obj);
- // either there is a writable cache or we need one to update
var cache = meta$$1.writableCache();
var hadCachedValue = false;
var cachedValue = void 0;
- if (cache[keyName] !== undefined) {
- if (cache[keyName] !== UNDEFINED) {
- cachedValue = cache[keyName];
+ var val = cache[keyName];
+ if (val !== undefined) {
+ if (val !== UNDEFINED) {
+ cachedValue = val;
}
hadCachedValue = true;
}
var ret = this._setter.call(obj, keyName, value, cachedValue);
@@ -26470,10 +26539,16 @@
return stack;
};
var onerror = void 0;
+ var onErrorTarget = {
+ get onerror() {
+ return dispatchOverride || onerror;
+ }
+ };
+
// Ember.onerror getter
function getOnerror() {
return onerror;
}
// Ember.onerror setter
@@ -26561,11 +26636,11 @@
if (!isObject$1(obj)) {
return undefined;
}
var meta$$1 = exports.peekMeta(obj);
- if (meta$$1) {
+ if (meta$$1 !== undefined) {
var map = meta$$1.readableWeak();
if (map !== undefined) {
var val = map[this._id];
if (val === UNDEFINED) {
return undefined;
@@ -26606,11 +26681,11 @@
if (!isObject$1(obj)) {
return false;
}
var meta$$1 = exports.peekMeta(obj);
- if (meta$$1) {
+ if (meta$$1 !== undefined) {
var map = meta$$1.readableWeak();
if (map !== undefined) {
return map[this._id] !== undefined;
}
}
@@ -26798,19 +26873,10 @@
function onEnd(current, next) {
run.currentRunLoop = next;
}
- var onErrorTarget = {
- get onerror() {
- return dispatchError;
- },
- set onerror(handler) {
- return setOnerror(handler);
- }
- };
-
var backburner$1 = new Backburner(['sync', 'actions', 'destroy'], {
GUID_KEY: emberUtils.GUID_KEY,
sync: {
before: beginPropertyChanges,
after: endPropertyChanges
@@ -26914,31 +26980,41 @@
TinyMCE provides a setup configuration option we can use to do some processing
after the TinyMCE instance is initialized but before it is actually rendered.
We can use that setup option to do some additional setup for our component.
The component itself could look something like the following:
- ```javascript
- App.RichTextEditorComponent = Ember.Component.extend({
+ ```app/components/rich-text-editor.js
+ import Component from '@ember/component';
+ import { bind } from '@ember/runloop';
+
+ export default Component.extend({
initializeTinyMCE: Ember.on('didInsertElement', function() {
tinymce.init({
selector: '#' + this.$().prop('id'),
setup: Ember.run.bind(this, this.setupEditor)
});
}),
+
+ didInsertElement() {
+ tinymce.init({
+ selector: '#' + this.$().prop('id'),
+ setup: Ember.run.bind(this, this.setupEditor)
+ });
+ }
- setupEditor: function(editor) {
+ setupEditor(editor) {
this.set('editor', editor);
editor.on('change', function() {
console.log('content changed!');
});
}
});
```
In this example, we use Ember.run.bind to bind the setupEditor method to the
- context of the App.RichTextEditorComponent and to have the invocation of that
+ context of the RichTextEditor component and to have the invocation of that
method be safely handled and executed by the Ember run loop.
@method bind
@namespace Ember
@param {Object} [target] target of method to call
@@ -27168,26 +27244,40 @@
run.scheduleOnce('afterRender', myContext, sayHi);
// sayHi will only be executed once, in the afterRender queue of the RunLoop
});
```
- Also note that passing an anonymous function to `run.scheduleOnce` will
- not prevent additional calls with an identical anonymous function from
- scheduling the items multiple times, e.g.:
+ Also note that for `run.scheduleOnce` to prevent additional calls, you need to
+ pass the same function instance. The following case works as expected:
```javascript
+ function log() {
+ console.log('Logging only once');
+ }
+
function scheduleIt() {
+ run.scheduleOnce('actions', myContext, log);
+ }
+
+ scheduleIt();
+ scheduleIt();
+ ```
+
+ But this other case will schedule the function multiple times:
+
+ ```javascript
+ function scheduleIt() {
run.scheduleOnce('actions', myContext, function() {
console.log('Closure');
});
}
scheduleIt();
scheduleIt();
// "Closure" will print twice, even though we're using `run.scheduleOnce`,
- // because the function we pass to it is anonymous and won't match the
+ // because the function we pass to it won't match the
// previously scheduled operation.
```
Available queues, and their order, can be found at `run.queues`
@@ -27231,12 +27321,14 @@
by the `ember-views` package, along with the preceding `render` queue
where all the DOM element operations happen).
Example:
- ```javascript
- export default Ember.Component.extend({
+ ```app/components/my-component.js
+ import Component from '@ember/component';
+
+ export Component.extend({
didInsertElement() {
this._super(...arguments);
run.scheduleOnce('afterRender', this, 'processChildElements');
},
@@ -28778,20 +28870,18 @@
var baseValue = values[key] || obj[key];
var ret = void 0;
if (baseValue === null || baseValue === undefined) {
ret = emberUtils.makeArray(value);
- } else {
- if (isArray(baseValue)) {
- if (value === null || value === undefined) {
- ret = baseValue;
- } else {
- ret = a_concat.call(baseValue, value);
- }
+ } else if (isArray(baseValue)) {
+ if (value === null || value === undefined) {
+ ret = baseValue;
} else {
- ret = a_concat.call(emberUtils.makeArray(baseValue), value);
+ ret = a_concat.call(baseValue, value);
}
+ } else {
+ ret = a_concat.call(emberUtils.makeArray(baseValue), value);
}
{
// it is possible to use concatenatedProperties with strings (which cannot be frozen)
// only freeze objects...
@@ -28858,11 +28948,11 @@
descs[key] = value;
values[key] = undefined;
} else {
if (concats && concats.indexOf(key) >= 0 || key === 'concatenatedProperties' || key === 'mergedProperties') {
value = applyConcatenatedProperties(base, key, value, values);
- } else if (mergings && mergings.indexOf(key) >= 0) {
+ } else if (mergings && mergings.indexOf(key) > -1) {
value = applyMergedProperties(base, key, value, values);
} else if (isMethod(value)) {
value = giveMethodSuper(base, key, value, values, descs);
}
@@ -28970,33 +29060,31 @@
}
return { desc: desc, value: value };
}
- function updateObserversAndListeners(obj, key, observerOrListener, pathsKey, updateMethod) {
- var paths = observerOrListener[pathsKey];
-
+ function updateObserversAndListeners(obj, key, paths, updateMethod) {
if (paths) {
for (var i = 0; i < paths.length; i++) {
updateMethod(obj, paths[i], null, key);
}
}
}
function replaceObserversAndListeners(obj, key, observerOrListener) {
var prev = obj[key];
- if ('function' === typeof prev) {
- updateObserversAndListeners(obj, key, prev, '__ember_observesBefore__', _removeBeforeObserver);
- updateObserversAndListeners(obj, key, prev, '__ember_observes__', removeObserver);
- updateObserversAndListeners(obj, key, prev, '__ember_listens__', removeListener);
+ if (typeof prev === 'function') {
+ updateObserversAndListeners(obj, key, prev.__ember_observesBefore__, _removeBeforeObserver);
+ updateObserversAndListeners(obj, key, prev.__ember_observes__, removeObserver);
+ updateObserversAndListeners(obj, key, prev.__ember_listens__, removeListener);
}
- if ('function' === typeof observerOrListener) {
- updateObserversAndListeners(obj, key, observerOrListener, '__ember_observesBefore__', _addBeforeObserver);
- updateObserversAndListeners(obj, key, observerOrListener, '__ember_observes__', addObserver);
- updateObserversAndListeners(obj, key, observerOrListener, '__ember_listens__', addListener);
+ if (typeof observerOrListener === 'function') {
+ updateObserversAndListeners(obj, key, observerOrListener.__ember_observesBefore__, _addBeforeObserver);
+ updateObserversAndListeners(obj, key, observerOrListener.__ember_observes__, addObserver);
+ updateObserversAndListeners(obj, key, observerOrListener.__ember_listens__, addListener);
}
}
function applyMixin(obj, mixins, partial) {
var descs = {};
@@ -29199,11 +29287,11 @@
Mixin.mixins = function mixins(obj) {
var meta$$1 = exports.peekMeta(obj);
var ret = [];
- if (!meta$$1) {
+ if (meta$$1 === undefined) {
return ret;
}
meta$$1.forEachMixins(function (key, currentMixin) {
// skip primitive mixins since these are always anonymous
@@ -29316,11 +29404,11 @@
}
if (obj instanceof Mixin) {
return _detect(obj, this, {});
}
var meta$$1 = exports.peekMeta(obj);
- if (!meta$$1) {
+ if (meta$$1 === undefined) {
return false;
}
return !!meta$$1.peekMixins(emberUtils.guidFor(this));
};
@@ -29391,19 +29479,25 @@
Alias.prototype = new Descriptor();
/**
Makes a method available via an additional name.
- ```javascript
- App.Person = Ember.Object.extend({
- name: function() {
+ ```app/utils/person.js
+ import EmberObject, {
+ aliasMethod
+ } from '@ember/object';
+
+ export default EmberObject.extend({
+ name() {
return 'Tomhuda Katzdale';
},
- moniker: Ember.aliasMethod('name')
+ moniker: aliasMethod('name')
});
+ ```
- let goodGuy = App.Person.create();
+ ```javascript
+ let goodGuy = Person.create();
goodGuy.name(); // 'Tomhuda Katzdale'
goodGuy.moniker(); // 'Tomhuda Katzdale'
```
@@ -29638,11 +29732,11 @@
}
function isProxy(value) {
if (typeof value === 'object' && value !== null) {
var meta$$1 = exports.peekMeta(value);
- return meta$$1 && meta$$1.isProxy();
+ return meta$$1 === undefined ? false : meta$$1.isProxy();
}
return false;
}
@@ -30449,18 +30543,18 @@
Using `HistoryLocation` results in URLs that are indistinguishable from a
standard URL. This relies upon the browser's `history` API.
Example:
- ```javascript
- App.Router.map(function() {
+ ```app/router.js
+ Router.map(function() {
this.route('posts', function() {
this.route('new');
});
});
- App.Router.reopen({
+ Router.reopen({
location: 'history'
});
```
This will result in a posts.new url of `/posts/new`.
@@ -30945,13 +31039,95 @@
@module ember
@submodule ember-routing
*/
var RouterService = _emberRuntime.Service.extend({
+
+ /**
+ Name of the current route.
+ This property represent the logical name of the route,
+ which is comma separated.
+ For the following router:
+ ```app/router.js
+ Router.map(function() {
+ this.route('about);
+ this.route('blog', function () {
+ this.route('post', { path: ':post_id' });
+ });
+ });
+ ```
+ It will return:
+ * `index` when you visit `/`
+ * `about` when you visit `/about`
+ * `blog.index` when you visit `/blog`
+ * `blog.post` when you visit `/blog/some-post-id`
+ @property currentRouteName
+ @type String
+ @public
+ */
currentRouteName: (0, _emberRuntime.readOnly)('_router.currentRouteName'),
+
+ /**
+ Current URL for the application.
+ This property represent the URL path for this route.
+ For the following router:
+ ```app/router.js
+ Router.map(function() {
+ this.route('about);
+ this.route('blog', function () {
+ this.route('post', { path: ':post_id' });
+ });
+ });
+ ```
+ It will return:
+ * `/` when you visit `/`
+ * `/about` when you visit `/about`
+ * `/blog/index` when you visit `/blog`
+ * `/blog/post` when you visit `/blog/some-post-id`
+ @property currentURL
+ @type String
+ @public
+ */
currentURL: (0, _emberRuntime.readOnly)('_router.currentURL'),
+
+ /**
+ The `location` property determines the type of URL's that your
+ application will use.
+ The following location types are currently available:
+ * `auto`
+ * `hash`
+ * `history`
+ * `none`
+ @property location
+ @default 'hash'
+ @see {Ember.Location}
+ @public
+ */
location: (0, _emberRuntime.readOnly)('_router.location'),
+
+ /**
+ The `rootURL` property represents the URL of the root of
+ the application, '/' by default.
+ This prefix is assumed on all routes defined on this app.
+ IF you change the `rootURL` in your environment configuration
+ like so:
+ ```config/environment.js
+ 'use strict';
+ module.exports = function(environment) {
+ let ENV = {
+ modulePrefix: 'router-service',
+ environment,
+ rootURL: '/my-root',
+ …
+ }
+ ]
+ ```
+ This property will return `/my-root`.
+ @property rootURL
+ @default '/'
+ @public
+ */
rootURL: (0, _emberRuntime.readOnly)('_router.rootURL'),
_router: null,
transitionTo: function () {
var queryParams = void 0;
@@ -31775,14 +31951,14 @@
/**
A hook you can use to reset controller values either when the model
changes or the route is exiting.
```app/routes/articles.js
- import Ember from 'ember';
- export default Ember.Route.extend({
+ import Route from '@ember/routing/route';
+ export default Route.extend({
resetController(controller, isExiting, transition) {
- if (isExiting) {
+ if (isExiting && transition.targetName !== 'error') {
controller.set('page', 1);
}
}
});
```
@@ -31815,12 +31991,12 @@
/**
The name of the template to use by default when rendering this routes
template.
```app/routes/posts/list.js
- import Ember from 'ember';
- export default Ember.Route.extend({
+ import Route from '@ember/routing/route';
+ export default Route.extend({
templateName: 'posts/list'
});
```
```app/routes/posts/index.js
import PostsList from '../posts/list';
@@ -31862,12 +32038,12 @@
argument. This action can be used for aborting, redirecting,
or decorating the transition from the currently active routes.
A good example is preventing navigation when a form is
half-filled out:
```app/routes/contact-form.js
- import Ember from 'ember';
- export default Ember.Route.extend({
+ import Route from '@ember/routing/route';
+ export default Route.extend({
actions: {
willTransition(transition) {
if (this.controller.get('userHasEnteredData')) {
this.controller.displayNavigationConfirm();
transition.abort();
@@ -31900,12 +32076,12 @@
hooks (`beforeModel`, `model`, `afterModel`, `setupController`)
have resolved. The `didTransition` action has no arguments,
however, it can be useful for tracking page views or resetting
state on the controller.
```app/routes/login.js
- import Ember from 'ember';
- export default Ember.Route.extend({
+ import Route from '@ember/routing/route';
+ export default Route.extend({
actions: {
didTransition() {
this.controller.get('errors.base').clear();
return true; // Bubble the didTransition event
}
@@ -31921,11 +32097,12 @@
The `loading` action is fired on the route when a route's `model`
hook returns a promise that is not already resolved. The current
`Transition` object is the first parameter and the route that
triggered the loading event is the second parameter.
```app/routes/application.js
- export default Ember.Route.extend({
+ import Route from '@ember/routing/route';
+ export default Route.extend({
actions: {
loading(transition, route) {
let controller = this.controllerFor('foo');
controller.set('currentlyLoading', true);
transition.finally(function() {
@@ -31950,12 +32127,12 @@
logic defined on a parent route.
Here is an example of an error handler that will be invoked
for rejected promises from the various hooks on the route,
as well as any unhandled errors from child routes:
```app/routes/admin.js
- import Ember from 'ember';
- export default Ember.Route.extend({
+ import Route from '@ember/routing/route';
+ export default Route.extend({
beforeModel() {
return Ember.RSVP.reject('bad things!');
},
actions: {
error(error, transition) {
@@ -31975,12 +32152,12 @@
`error` actions that bubble up all the way to `ApplicationRoute`
will fire a default error handler that logs the error. You can
specify your own global default error handler by overriding the
`error` handler on `ApplicationRoute`:
```app/routes/application.js
- import Ember from 'ember';
- export default Ember.Route.extend({
+ import Route from '@ember/routing/route';
+ export default Route.extend({
actions: {
error(error, transition) {
this.controllerFor('banner').displayError(error.message);
}
}
@@ -31995,12 +32172,12 @@
/**
This event is triggered when the router enters the route. It is
not executed when the model for the route changes.
```app/routes/application.js
- import Ember from 'ember';
- export default Ember.Route.extend({
+ import Route from '@ember/routing/route';
+ export default Route.extend({
collectAnalytics: Ember.on('activate', function(){
collectAnalytics();
})
});
```
@@ -32011,12 +32188,12 @@
/**
This event is triggered when the router completely exits this
route. It is not executed when the model for the route changes.
```app/routes/index.js
- import Ember from 'ember';
- export default Ember.Route.extend({
+ import Route from '@ember/routing/route';
+ export default Route.extend({
trackPageLeaveAnalytics: Ember.on('deactivate', function(){
trackPageLeaveAnalytics();
})
});
```
@@ -32027,12 +32204,12 @@
/**
The controller associated with this route.
Example
```app/routes/form.js
- import Ember from 'ember';
- export default Ember.Route.extend({
+ import Route from '@ember/routing/route';
+ export default Route.extend({
actions: {
willTransition(transition) {
if (this.controller.get('userHasEnteredData') &&
!confirm('Are you sure you want to abandon progress?')) {
transition.abort();
@@ -32315,12 +32492,12 @@
but is provided the route's resolved model in addition to
the `transition`, and is therefore suited to performing
logic that can only take place after the model has already
resolved.
```app/routes/posts.js
- import Ember from 'ember';
- export default Ember.Route.extend({
+ import Route from '@ember/routing/route';
+ export default Route.extend({
afterModel(posts, transition) {
if (posts.get('length') === 1) {
this.transitionTo('post.show', posts.get('firstObject'));
}
}
@@ -32456,12 +32633,12 @@
Router.map(function() {
this.route('post', { path: '/posts/:post_id' });
});
```
```app/routes/post.js
- import Ember from 'ember';
- export default Ember.Route.extend({
+ import Route from '@ember/routing/route';
+ export default Route.extend({
model(params) {
// the server returns `{ id: 12 }`
return Ember.$.getJSON('/posts/' + params.post_id);
},
serialize(model) {
@@ -32873,11 +33050,11 @@
The following location types are currently available:
* `history` - use the browser's history API to make the URLs look just like any standard URL
* `hash` - use `#` to separate the server part of the URL from the Ember part: `/blog/#/posts/new`
* `none` - do not store the Ember URL in the actual browser URL (mainly used for testing)
* `auto` - use the best option based on browser capabilities: `history` if possible, then `hash` if possible, otherwise `none`
- Note: If using ember-cli, this value is defaulted to `auto` by the `locationType` setting of `/config/environment.js`
+ This value is defaulted to `auto` by the `locationType` setting of `/config/environment.js`
@property location
@default 'hash'
@see {Ember.Location}
@public
*/
@@ -33695,18 +33872,22 @@
// We don't check for an 'error' route on the originRoute, since that would
// technically be below where we're at in the route hierarchy.
if (originRoute !== route) {
var errorRouteName = findRouteStateName(route, 'error');
if (errorRouteName) {
+ var _errorId = (0, _emberUtils.guidFor)(error);
+ router._markErrorAsHandled(_errorId);
router.intermediateTransitionTo(errorRouteName, error);
return false;
}
}
// Check for an 'error' substate route
var errorSubstateName = findRouteSubstateName(route, 'error');
if (errorSubstateName) {
+ var errorId = (0, _emberUtils.guidFor)(error);
+ router._markErrorAsHandled(errorId);
router.intermediateTransitionTo(errorSubstateName, error);
return false;
}
return true;
@@ -35235,13 +35416,13 @@
var arr = (0, _emberMetal.get)(this, dependentKey);
if (arr === null || typeof arr !== 'object') {
return initialValue;
}
return arr.reduce(callback, initialValue, this);
- }, { dependentKeys: [dependentKey + '.[]'] });
+ }, { dependentKeys: [dependentKey + '.[]'], readOnly: true });
- return cp.readOnly();
+ return cp;
}
function arrayMacro(dependentKey, callback) {
// This is a bit ugly
var propertyName = void 0;
@@ -35257,25 +35438,25 @@
if ((0, _utils.isArray)(value)) {
return (0, _native_array.A)(callback.call(this, value));
} else {
return (0, _native_array.A)();
}
- }, { dependentKeys: [dependentKey] });
+ }, { dependentKeys: [dependentKey], readOnly: true });
- return cp.readOnly();
+ return cp;
}
function multiArrayMacro(_dependentKeys, callback) {
var dependentKeys = _dependentKeys.map(function (key) {
return key + '.[]';
});
var cp = new _emberMetal.ComputedProperty(function () {
return (0, _native_array.A)(callback.call(this, _dependentKeys));
- }, { dependentKeys: dependentKeys });
+ }, { dependentKeys: dependentKeys, readOnly: true });
- return cp.readOnly();
+ return cp;
}
/**
A computed property that returns the sum of the values
in the dependent array.
@@ -35657,11 +35838,11 @@
@return {Ember.ComputedProperty} computes a new array with all the
unique elements from the dependent array
@public
*/
function uniqBy(dependentKey, propertyKey) {
- return (0, _emberMetal.computed)(dependentKey + '.[]', function () {
+ var cp = new _emberMetal.ComputedProperty(function () {
var uniq = (0, _native_array.A)();
var seen = Object.create(null);
var list = (0, _emberMetal.get)(this, dependentKey);
if ((0, _utils.isArray)(list)) {
list.forEach(function (item) {
@@ -35671,11 +35852,13 @@
uniq.push(item);
}
});
}
return uniq;
- }).readOnly();
+ }, { dependentKeys: [dependentKey + '.[]'], readOnly: true });
+
+ return cp;
}
/**
A computed property which returns a new array with all the unique
elements from one or more dependent arrays.
@@ -35808,11 +35991,11 @@
*/
function setDiff(setAProperty, setBProperty) {
(true && !(arguments.length === 2) && (0, _emberDebug.assert)('Ember.computed.setDiff requires exactly two dependent arrays.', arguments.length === 2));
- return (0, _emberMetal.computed)(setAProperty + '.[]', setBProperty + '.[]', function () {
+ var cp = new _emberMetal.ComputedProperty(function () {
var setA = this.get(setAProperty);
var setB = this.get(setBProperty);
if (!(0, _utils.isArray)(setA)) {
return (0, _native_array.A)();
@@ -35822,11 +36005,16 @@
}
return setA.filter(function (x) {
return setB.indexOf(x) === -1;
});
- }).readOnly();
+ }, {
+ dependentKeys: [setAProperty + '.[]', setBProperty + '.[]'],
+ readOnly: true
+ });
+
+ return cp;
}
/**
A computed property that returns the array of values
for the provided dependent properties.
@@ -36005,15 +36193,15 @@
});
activeObserversMap.set(this, activeObservers);
return sortByNormalizedSortProperties(items, normalizedSortProperties);
- }, { dependentKeys: [sortPropertiesKey + '.[]'] });
+ }, { dependentKeys: [sortPropertiesKey + '.[]'], readOnly: true });
cp._activeObserverMap = undefined;
- return cp.readOnly();
+ return cp;
}
function normalizeSortProperties(sortProperties) {
return sortProperties.map(function (p) {
var _p$split = p.split(':'),
@@ -36036,11 +36224,10 @@
var result = (0, _compare.default)((0, _emberMetal.get)(itemA, prop), (0, _emberMetal.get)(itemB, prop));
if (result !== 0) {
return direction === 'desc' ? -1 * result : result;
}
}
-
return 0;
}));
}
});
enifed('ember-runtime/controllers/controller', ['exports', 'ember-debug', 'ember-runtime/system/object', 'ember-runtime/mixins/controller', 'ember-runtime/inject', 'ember-runtime/mixins/action_handler'], function (exports, _emberDebug, _object, _controller, _inject, _action_handler) {
@@ -36070,24 +36257,31 @@
Creates a property that lazily looks up another controller in the container.
Can only be used when defining another controller.
Example:
- ```javascript
- App.PostController = Ember.Controller.extend({
- posts: Ember.inject.controller()
+ ```app/controllers/post.js
+ import Controller, {
+ inject as controller
+ } from '@ember/controller';
+
+ export default Controller.extend({
+ posts: controller()
});
```
This example will create a `posts` property on the `post` controller that
looks up the `posts` controller in the container, making it easy to
reference other controllers. This is functionally equivalent to:
- ```javascript
- App.PostController = Ember.Controller.extend({
+ ```app/controllers/post.js
+ import Controller from '@ember/controller';
+ import { alias } from '@ember/object/computed';
+
+ export default Controller.extend({
needs: 'posts',
- posts: Ember.computed.alias('controllers.posts')
+ posts: alias('controllers.posts')
});
```
@method controller
@since 1.10.0
@@ -36211,19 +36405,22 @@
/**
The `property` extension of Javascript's Function prototype is available
when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is
`true`, which is the default.
Computed properties allow you to treat a function like a property:
- ```javascript
- MyApp.President = Ember.Object.extend({
+ ```app/utils/president.js
+ import EmberObject from '@ember/object';
+ export default EmberObject.extend({
firstName: '',
lastName: '',
fullName: function() {
return this.get('firstName') + ' ' + this.get('lastName');
}.property() // Call this flag to mark the function as a property
});
- let president = MyApp.President.create({
+ ```
+ ```javascript
+ let president = President.create({
firstName: 'Barack',
lastName: 'Obama'
});
president.get('fullName'); // 'Barack Obama'
```
@@ -36231,12 +36428,13 @@
bindings, just like any other property.
Many computed properties have dependencies on other properties. For
example, in the above example, the `fullName` property depends on
`firstName` and `lastName` to determine its value. You can tell Ember
about these dependencies like this:
- ```javascript
- MyApp.President = Ember.Object.extend({
+ ```app/utils/president.js
+ import EmberObject from '@ember/object';
+ export default EmberObject.extend({
firstName: '',
lastName: '',
fullName: function() {
return this.get('firstName') + ' ' + this.get('lastName');
// Tell Ember.js that this computed property depends on firstName
@@ -36264,11 +36462,12 @@
true, which is the default.
You can observe property changes simply by adding the `observes`
call to the end of your method declarations in classes that you write.
For example:
```javascript
- Ember.Object.extend({
+ import EmberObject from '@ember/object';
+ EmberObject.extend({
valueObserver: function() {
// Executes whenever the "value" property changes
}.observes('value')
});
```
@@ -36308,11 +36507,12 @@
`EmberENV.EXTEND_PROTOTYPES.Function` is true, which is the default.
You can observe property changes simply by adding the `observesImmediately`
call to the end of your method declarations in classes that you write.
For example:
```javascript
- Ember.Object.extend({
+ import EmberObject from '@ember/object';
+ EmberObject.extend({
valueObserver: function() {
// Executes immediately after the "value" property changes
}.observesImmediately('value')
});
```
@@ -36331,11 +36531,12 @@
when `EmberENV.EXTEND_PROTOTYPES` or `EmberENV.EXTEND_PROTOTYPES.Function` is
true, which is the default.
You can listen for events simply by adding the `on` call to the end of
your method declarations in classes or mixins that you write. For example:
```javascript
- Ember.Mixin.create({
+ import Mixin from '@ember/mixin';
+ Mixin.create({
doSomethingWithElement: function() {
// Executes whenever the "didInsertElement" event fires
}.on('didInsertElement')
});
```
@@ -37363,15 +37564,11 @@
function removeArrayObserver(array, target, opts) {
return arrayObserversHelper(array, target, opts, _emberMetal.removeListener, true);
}
function objectAt(content, idx) {
- if (content.objectAt) {
- return content.objectAt(idx);
- }
-
- return content[idx];
+ return typeof content.objectAt === 'function' ? content.objectAt(idx) : content[idx];
}
function arrayContentWillChange(array, startIdx, removeAmt, addAmt) {
var removing = void 0,
lim = void 0;
@@ -37446,11 +37643,11 @@
}
(0, _emberMetal.sendEvent)(array, '@array:change', [array, startIdx, removeAmt, addAmt]);
var meta = (0, _emberMetal.peekMeta)(array);
- var cache = meta && meta.readableCache();
+ var cache = meta !== undefined ? meta.readableCache() : undefined;
if (cache !== undefined) {
var length = (0, _emberMetal.get)(array, 'length');
var addedAmount = addAmt === -1 ? 0 : addAmt;
var removedAmount = removeAmt === -1 ? 0 : removeAmt;
var delta = addedAmount - removedAmount;
@@ -37476,11 +37673,11 @@
}
var EMBER_ARRAY = (0, _emberUtils.symbol)('EMBER_ARRAY');
function isEmberArray(obj) {
- return obj && !!obj[EMBER_ARRAY];
+ return obj && obj[EMBER_ARRAY];
}
// ..........................................................
// ARRAY
//
@@ -37556,21 +37753,17 @@
var ret = _emberMetal.default.A();
var length = (0, _emberMetal.get)(this, 'length');
if ((0, _emberMetal.isNone)(beginIndex)) {
beginIndex = 0;
+ } else if (beginIndex < 0) {
+ beginIndex = length + beginIndex;
}
if ((0, _emberMetal.isNone)(endIndex) || endIndex > length) {
endIndex = length;
- }
-
- if (beginIndex < 0) {
- beginIndex = length + beginIndex;
- }
-
- if (endIndex < 0) {
+ } else if (endIndex < 0) {
endIndex = length + endIndex;
}
while (beginIndex < endIndex) {
ret[ret.length] = objectAt(this, beginIndex++);
@@ -38548,26 +38741,26 @@
'use strict';
exports.default = _emberMetal.Mixin.create({
/**
- Subscribes to a named event with given function.
- ```javascript
- person.on('didLoad', function() {
- // fired once the person has loaded
- });
- ```
- An optional target can be passed in as the 2nd argument that will
- be set as the "this" for the callback. This is a good way to give your
- function access to the object triggering the event. When the target
- parameter is used the callback becomes the third argument.
- @method on
- @param {String} name The name of the event
- @param {Object} [target] The "this" binding for the callback
- @param {Function} method The callback to execute
- @return this
- @public
+ Subscribes to a named event with given function.
+ ```javascript
+ person.on('didLoad', function() {
+ // fired once the person has loaded
+ });
+ ```
+ An optional target can be passed in as the 2nd argument that will
+ be set as the "this" for the callback. This is a good way to give your
+ function access to the object triggering the event. When the target
+ parameter is used the callback becomes the third argument.
+ @method on
+ @param {String} name The name of the event
+ @param {Object} [target] The "this" binding for the callback
+ @param {Function} method The callback to execute
+ @return this
+ @public
*/
on: function (name, target, method) {
(0, _emberMetal.addListener)(this, name, target, method);
return this;
},
@@ -39415,12 +39608,13 @@
will be notified. Note that the observers are triggered any time the
value is set, regardless of whether it has actually changed. Your
observer should be prepared to handle that.
### Observer Methods
Observer methods have the following signature:
- ```javascript
- export default Ember.Component.extend({
+ ```app/components/my-component.js
+ import Component from '@ember/component';
+ export default Component.extend({
init() {
this._super(...arguments);
this.addObserver('foo', this, 'fooDidChange');
},
fooDidChange(sender, key, value, rev) {
@@ -39613,11 +39807,11 @@
```javascript
let ObjectPromiseProxy = Ember.ObjectProxy.extend(Ember.PromiseProxyMixin);
let proxy = ObjectPromiseProxy.create({
- promise: Ember.RSVP.cast($.getJSON('/some/remote/data.json'))
+ promise: Ember.RSVP.resolve($.getJSON('/some/remote/data.json'))
});
proxy.then(function(json){
// the json
}, function(reason) {
@@ -39636,11 +39830,11 @@
```
When the $.getJSON completes, and the promise is fulfilled
with json, the life cycle attributes will update accordingly.
Note that $.getJSON doesn't return an ECMA specified promise,
- it is useful to wrap this with an `RSVP.cast` so that it behaves
+ it is useful to wrap this with an `RSVP.resolve` so that it behaves
as a spec compliant promise.
```javascript
proxy.get('isPending') //=> false
proxy.get('isSettled') //=> true
@@ -41313,12 +41507,14 @@
ember or when you can not guarantee that `EmberENV.EXTEND_PROTOTYPES`
will be `true`.
Example
- ```js
- export default Ember.Component.extend({
+ ```app/components/my-component.js
+ import Component from '@ember/component';
+
+ export default Component.extend({
tagName: 'ul',
classNames: ['pagination'],
init() {
this._super(...arguments);
@@ -41447,14 +41643,17 @@
Creates a property that lazily looks up a service in the container. There
are no restrictions as to what objects a service can be injected into.
Example:
- ```javascript
- App.ApplicationRoute = Ember.Route.extend({
- authManager: Ember.inject.service('auth'),
+ ```app/routes/application.js
+ import Route from '@ember/routing/route';
+ import { inject as service } from '@ember/service';
+ export default Route.extend({
+ authManager: service('auth'),
+
model() {
return this.get('authManager').findCurrentUser();
}
});
```
@@ -45177,21 +45376,24 @@
For example, this component dynamically looks up a service based on the
`audioType` passed as an attribute:
```app/components/play-audio.js
- import Ember from 'ember';
-
+ import Component from '@ember/component';
+ import { computed } from '@ember/object';
+ import { getOwner } from '@ember/application';
+
// Usage:
//
// {{play-audio audioType=model.audioType audioFile=model.file}}
//
- export default Ember.Component.extend({
- audioService: Ember.computed('audioType', function() {
- let owner = Ember.getOwner(this);
+ export default Component.extend({
+ audioService: computed('audioType', function() {
+ let owner = getOwner(this);
return owner.lookup(`service:${this.get('audioType')}`);
}),
+
click() {
let player = this.get('audioService');
player.play(this.get('audioFile'));
}
});
@@ -45484,11 +45686,11 @@
@return {*} the return value of the invoked method or undefined if it cannot be invoked
@public
*/
function tryInvoke(obj, methodName, args) {
if (canInvoke(obj, methodName)) {
- return args ? applyStr(obj, methodName, args) : applyStr(obj, methodName);
+ return applyStr(obj, methodName, args);
}
}
var isArray = Array.isArray;
@@ -45837,13 +46039,13 @@
/**
Calls an action passed to a component.
For example a component for playing or pausing music may translate click events
into action notifications of "play" or "stop" depending on some internal state
of the component:
- ```javascript
- // app/components/play-button.js
- export default Ember.Component.extend({
+ ```app/components/play-button.js
+ import Component from '@ember/component';
+ export default Component.extend({
click() {
if (this.get('isPlaying')) {
this.sendAction('play');
} else {
this.sendAction('stop');
@@ -45857,13 +46059,13 @@
{{play-button play=(action "musicStarted") stop=(action "musicStopped")}}
```
When the component receives a browser `click` event it translate this
interaction into application-specific semantics ("play" or "stop") and
calls the specified action.
- ```javascript
- // app/controller/application.js
- export default Ember.Controller.extend({
+ ```app/controller/application.js
+ import Controller from '@ember/controller';
+ export default Controller.extend({
actions: {
musicStarted() {
// called when the play button is clicked
// and the music started playing
},
@@ -45874,25 +46076,25 @@
}
});
```
If no action is passed to `sendAction` a default name of "action"
is assumed.
- ```javascript
- // app/components/next-button.js
- export default Ember.Component.extend({
+ ```app/components/next-button.js
+ import Component from '@ember/component';
+ export default Component.extend({
click() {
this.sendAction();
}
});
```
```handlebars
{{! app/templates/application.hbs }}
{{next-button action=(action "playNextSongInAlbum")}}
```
- ```javascript
- // app/controllers/application.js
- App.ApplicationController = Ember.Controller.extend({
+ ```app/controllers/application.js
+ import Controller from '@ember/controller';
+ export default Controller.extend({
actions: {
playNextSongInAlbum() {
...
}
}
@@ -46428,31 +46630,34 @@
/**
A list of properties of the view to apply as attributes. If the property
is a string value, the value of that string will be applied as the value
for an attribute of the property's name.
The following example creates a tag like `<div priority="high" />`.
- ```javascript
- Ember.Component.extend({
+ ```app/components/my-component.js
+ import Component from '@ember/component';
+ export default Component.extend({
attributeBindings: ['priority'],
priority: 'high'
});
```
If the value of the property is a Boolean, the attribute is treated as
an HTML Boolean attribute. It will be present if the property is `true`
and omitted if the property is `false`.
The following example creates markup like `<div visible />`.
- ```javascript
- Ember.Component.extend({
+ ```app/components/my-component.js
+ import Component from '@ember/component';
+ export default Component.extend({
attributeBindings: ['visible'],
visible: true
});
```
If you would prefer to use a custom value instead of the property name,
you can create the same markup as the last example with a binding like
this:
- ```javascript
- Ember.Component.extend({
+ ```app/components/my-component.js
+ import Component from '@ember/component';
+ export default Component.extend({
attributeBindings: ['isVisible:visible'],
isVisible: true
});
```
This list of attributes is inherited from the component's superclasses,
@@ -47836,39 +48041,39 @@
computed.union = _emberRuntime.union;
computed.intersect = _emberRuntime.intersect;
computed.collect = _emberRuntime.collect;
/**
- Defines the hash of localized strings for the current language. Used by
- the `Ember.String.loc()` helper. To localize, add string values to this
- hash.
+ Defines the hash of localized strings for the current language. Used by
+ the `Ember.String.loc()` helper. To localize, add string values to this
+ hash.
- @property STRINGS
- @for Ember
- @type Object
- @private
- */
+ @property STRINGS
+ @for Ember
+ @type Object
+ @private
+ */
Object.defineProperty(_emberMetal.default, 'STRINGS', {
configurable: false,
get: _emberRuntime.getStrings,
set: _emberRuntime.setStrings
});
/**
- Whether searching on the global for new Namespace instances is enabled.
+ Whether searching on the global for new Namespace instances is enabled.
- This is only exported here as to not break any addons. Given the new
- visit API, you will have issues if you treat this as a indicator of
- booted.
+ This is only exported here as to not break any addons. Given the new
+ visit API, you will have issues if you treat this as a indicator of
+ booted.
- Internally this is only exposing a flag in Namespace.
+ Internally this is only exposing a flag in Namespace.
- @property BOOTED
- @for Ember
- @type Boolean
- @private
- */
+ @property BOOTED
+ @for Ember
+ @type Boolean
+ @private
+ */
Object.defineProperty(_emberMetal.default, 'BOOTED', {
configurable: false,
enumerable: false,
get: _emberRuntime.isNamespaceSearchDisabled,
set: _emberRuntime.setNamespaceSearchDisabled
@@ -47901,19 +48106,19 @@
_emberRuntime.String.htmlSafe = _emberGlimmer.htmlSafe;
_emberRuntime.String.isHTMLSafe = _emberGlimmer.isHTMLSafe;
/**
- Global hash of shared templates. This will automatically be populated
- by the build tools so that you can store your Handlebars templates in
- separate files that get loaded into JavaScript at buildtime.
+ Global hash of shared templates. This will automatically be populated
+ by the build tools so that you can store your Handlebars templates in
+ separate files that get loaded into JavaScript at buildtime.
- @property TEMPLATES
- @for Ember
- @type Object
- @private
- */
+ @property TEMPLATES
+ @for Ember
+ @type Object
+ @private
+ */
Object.defineProperty(_emberMetal.default, 'TEMPLATES', {
get: _emberGlimmer.getTemplates,
set: _emberGlimmer.setTemplates,
configurable: false,
enumerable: false
@@ -47921,29 +48126,31 @@
exports.VERSION = _version.default;
/**
- The semantic version
- @property VERSION
- @type String
- @public
- */
+ The semantic version
+
+ @property VERSION
+ @type String
+ @public
+ */
_emberMetal.default.VERSION = _version.default;
_emberMetal.libraries.registerCoreLibrary('Ember', _version.default);
// require the main entry points for each of these packages
// this is so that the global exports occur properly
+
/**
- Alias for jQuery
+ Alias for jQuery
- @method $
- @for Ember
- @public
- */
+ @method $
+ @for Ember
+ @public
+ */
_emberMetal.default.$ = _emberViews.jQuery;
_emberMetal.default.ViewTargetActionSupport = _emberViews.ViewTargetActionSupport;
_emberMetal.default.ViewUtils = {
@@ -47999,11 +48206,11 @@
}
(0, _emberRuntime.runLoadHooks)('Ember');
/**
- @module ember
+ @module ember
*/
exports.default = _emberMetal.default;
/* globals module */
@@ -48014,10 +48221,10 @@
}
});
enifed("ember/version", ["exports"], function (exports) {
"use strict";
- exports.default = "2.16.0-beta.1";
+ exports.default = "2.16.0-beta.2";
});
enifed("handlebars", ["exports"], function (exports) {
"use strict";
// File ignored in coverage tests via setting in .istanbul.yml