ember-source 4.2.0-alpha.1 → 4.2.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/blueprints/route/files/__root__/__path__/__name__.js +8 -1
- package/blueprints/route/index.js +2 -0
- package/blueprints/route/native-files/__root__/__path__/__name__.js +8 -1
- package/build-metadata.json +3 -3
- package/dist/ember-template-compiler.js +2 -2
- package/dist/ember-template-compiler.map +1 -1
- package/dist/ember-testing.js +1 -1
- package/dist/ember-testing.map +1 -1
- package/dist/ember.debug.js +5 -6
- package/dist/ember.debug.map +1 -1
- package/dist/header/license.js +1 -1
- package/dist/packages/@ember/-internals/routing/lib/system/route.js +2 -4
- package/dist/packages/ember/version.js +1 -1
- package/docs/data.json +55 -55
- package/lib/browsers.js +50 -0
- package/lib/index.js +4 -0
- package/package.json +5 -5
package/dist/header/license.js
CHANGED
|
@@ -14,7 +14,6 @@ import { isProxy, lookupDescriptor, symbol } from '@ember/-internals/utils';
|
|
|
14
14
|
import { assert, info, isTesting } from '@ember/debug';
|
|
15
15
|
import { dependentKeyCompat } from '@ember/object/compat';
|
|
16
16
|
import { once } from '@ember/runloop';
|
|
17
|
-
import { classify } from '@ember/string';
|
|
18
17
|
import { DEBUG } from '@glimmer/env';
|
|
19
18
|
import { PARAMS_SYMBOL, STATE_SYMBOL } from 'router_js';
|
|
20
19
|
import { calculateCacheKey, deprecateTransitionMethods, normalizeControllerQueryParams, prefixRouteNameArg, stashParamNames } from '../utils';
|
|
@@ -1332,18 +1331,17 @@ class Route extends EmberObject.extend(ActionHandler, Evented) {
|
|
|
1332
1331
|
get store() {
|
|
1333
1332
|
let owner = getOwner(this);
|
|
1334
1333
|
let routeName = this.routeName;
|
|
1335
|
-
let namespace = get(this, '_router.namespace');
|
|
1336
1334
|
return {
|
|
1337
1335
|
find(name, value) {
|
|
1338
1336
|
let modelClass = owner.factoryFor(`model:${name}`);
|
|
1339
|
-
assert(`You used the dynamic segment
|
|
1337
|
+
assert(`You used the dynamic segment \`${name}_id\` in your route ` + `\`${routeName}\` for which Ember requires you provide a ` + `data-loading implementation. Commonly, that is done by ` + `adding a model hook implementation on the route ` + `(\`model({${name}_id}) {\`) or by injecting an implemention of ` + `a data store: \`@service store;\`.`, Boolean(modelClass));
|
|
1340
1338
|
|
|
1341
1339
|
if (!modelClass) {
|
|
1342
1340
|
return;
|
|
1343
1341
|
}
|
|
1344
1342
|
|
|
1345
1343
|
modelClass = modelClass.class;
|
|
1346
|
-
assert(
|
|
1344
|
+
assert(`You used the dynamic segment \`${name}_id\` in your route ` + `\`${routeName}\` for which Ember requires you provide a ` + `data-loading implementation. Commonly, that is done by ` + `adding a model hook implementation on the route ` + `(\`model({${name}_id}) {\`) or by injecting an implemention of ` + `a data store: \`@service store;\`.\n\n` + `Rarely, applications may attempt to use a legacy behavior where ` + `the model class (in this case \`${name}\`) is resolved and the ` + `\`find\` method on that class is invoked to load data. In this ` + `application, a model of \`${name}\` was found but it did not ` + `provide a \`find\` method. You should not add a \`find\` ` + `method to your model. Instead, please implement an appropriate ` + `\`model\` hook on the \`${routeName}\` route.`, typeof modelClass.find === 'function');
|
|
1347
1345
|
return modelClass.find(value);
|
|
1348
1346
|
}
|
|
1349
1347
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default "4.2.0-alpha.
|
|
1
|
+
export default "4.2.0-alpha.5";
|
package/docs/data.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "The Ember API",
|
|
4
4
|
"description": "The Ember API: a framework for building ambitious web applications",
|
|
5
5
|
"url": "https://emberjs.com/",
|
|
6
|
-
"version": "4.2.0-alpha.
|
|
6
|
+
"version": "4.2.0-alpha.5"
|
|
7
7
|
},
|
|
8
8
|
"files": {
|
|
9
9
|
"node_modules/rsvp/lib/rsvp/promise/all.js": {
|
|
@@ -2922,7 +2922,7 @@
|
|
|
2922
2922
|
"module": "@ember/routing",
|
|
2923
2923
|
"namespace": "",
|
|
2924
2924
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
2925
|
-
"line":
|
|
2925
|
+
"line": 84,
|
|
2926
2926
|
"description": "The `Route` class is used to define individual routes. Refer to\nthe [routing guide](https://guides.emberjs.com/release/routing/) for documentation.",
|
|
2927
2927
|
"extends": "EmberObject",
|
|
2928
2928
|
"uses": [
|
|
@@ -8765,7 +8765,7 @@
|
|
|
8765
8765
|
},
|
|
8766
8766
|
{
|
|
8767
8767
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
8768
|
-
"line":
|
|
8768
|
+
"line": 146,
|
|
8769
8769
|
"description": "Configuration hash for this route's queryParams. The possible\nconfiguration options and their defaults are as follows\n(assuming a query param whose controller property is `page`):\n\n```javascript\nqueryParams: {\n page: {\n // By default, controller query param properties don't\n // cause a full transition when they are changed, but\n // rather only cause the URL to update. Setting\n // `refreshModel` to true will cause an \"in-place\"\n // transition to occur, whereby the model hooks for\n // this route (and any child routes) will re-fire, allowing\n // you to reload models (e.g., from the server) using the\n // updated query param values.\n refreshModel: false,\n\n // By default, changes to controller query param properties\n // cause the URL to update via `pushState`, which means an\n // item will be added to the browser's history, allowing\n // you to use the back button to restore the app to the\n // previous state before the query param property was changed.\n // Setting `replace` to true will use `replaceState` (or its\n // hash location equivalent), which causes no browser history\n // item to be added. This options name and default value are\n // the same as the `link-to` helper's `replace` option.\n replace: false,\n\n // By default, the query param URL key is the same name as\n // the controller property name. Use `as` to specify a\n // different URL key.\n as: 'page'\n }\n}\n```",
|
|
8770
8770
|
"itemtype": "property",
|
|
8771
8771
|
"name": "queryParams",
|
|
@@ -8778,7 +8778,7 @@
|
|
|
8778
8778
|
},
|
|
8779
8779
|
{
|
|
8780
8780
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
8781
|
-
"line":
|
|
8781
|
+
"line": 192,
|
|
8782
8782
|
"description": "The name of the template to use by default when rendering this routes\ntemplate.\n\n```app/routes/posts/list.js\nimport Route from '@ember/routing/route';\n\nexport default class extends Route {\n templateName = 'posts/list'\n});\n```\n\n```app/routes/posts/index.js\nimport PostsList from '../posts/list';\n\nexport default class extends PostsList {};\n```\n\n```app/routes/posts/archived.js\nimport PostsList from '../posts/list';\n\nexport default class extends PostsList {};\n```",
|
|
8783
8783
|
"itemtype": "property",
|
|
8784
8784
|
"name": "templateName",
|
|
@@ -8792,7 +8792,7 @@
|
|
|
8792
8792
|
},
|
|
8793
8793
|
{
|
|
8794
8794
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
8795
|
-
"line":
|
|
8795
|
+
"line": 225,
|
|
8796
8796
|
"description": "The name of the controller to associate with this route.\n\nBy default, Ember will lookup a route's controller that matches the name\nof the route (i.e. `posts.new`). However,\nif you would like to define a specific controller to use, you can do so\nusing this property.\n\nThis is useful in many ways, as the controller specified will be:\n\n* passed to the `setupController` method.\n* used as the controller for the template being rendered by the route.\n* returned from a call to `controllerFor` for the route.",
|
|
8797
8797
|
"itemtype": "property",
|
|
8798
8798
|
"name": "controllerName",
|
|
@@ -8806,7 +8806,7 @@
|
|
|
8806
8806
|
},
|
|
8807
8807
|
{
|
|
8808
8808
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
8809
|
-
"line":
|
|
8809
|
+
"line": 248,
|
|
8810
8810
|
"description": "The controller associated with this route.\n\nExample\n\n```app/routes/form.js\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class FormRoute extends Route {\n @action\n willTransition(transition) {\n if (this.controller.get('userHasEnteredData') &&\n !confirm('Are you sure you want to abandon progress?')) {\n transition.abort();\n } else {\n // Bubble the `willTransition` action so that\n // parent routes can decide whether or not to abort.\n return true;\n }\n }\n}\n```",
|
|
8811
8811
|
"itemtype": "property",
|
|
8812
8812
|
"name": "controller",
|
|
@@ -8819,7 +8819,7 @@
|
|
|
8819
8819
|
},
|
|
8820
8820
|
{
|
|
8821
8821
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
8822
|
-
"line":
|
|
8822
|
+
"line": 279,
|
|
8823
8823
|
"description": "The name of the route, dot-delimited.\n\nFor example, a route found at `app/routes/posts/post.js` will have\na `routeName` of `posts.post`.",
|
|
8824
8824
|
"itemtype": "property",
|
|
8825
8825
|
"name": "routeName",
|
|
@@ -8832,7 +8832,7 @@
|
|
|
8832
8832
|
},
|
|
8833
8833
|
{
|
|
8834
8834
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
8835
|
-
"line":
|
|
8835
|
+
"line": 293,
|
|
8836
8836
|
"description": "The name of the route, dot-delimited, including the engine prefix\nif applicable.\n\nFor example, a route found at `addon/routes/posts/post.js` within an\nengine named `admin` will have a `fullRouteName` of `admin.posts.post`.",
|
|
8837
8837
|
"itemtype": "property",
|
|
8838
8838
|
"name": "fullRouteName",
|
|
@@ -8845,7 +8845,7 @@
|
|
|
8845
8845
|
},
|
|
8846
8846
|
{
|
|
8847
8847
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
8848
|
-
"line":
|
|
8848
|
+
"line": 308,
|
|
8849
8849
|
"description": "Sets the name for this route, including a fully resolved name for routes\ninside engines.",
|
|
8850
8850
|
"access": "private",
|
|
8851
8851
|
"tagname": "",
|
|
@@ -8863,7 +8863,7 @@
|
|
|
8863
8863
|
},
|
|
8864
8864
|
{
|
|
8865
8865
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
8866
|
-
"line":
|
|
8866
|
+
"line": 321,
|
|
8867
8867
|
"access": "private",
|
|
8868
8868
|
"tagname": "",
|
|
8869
8869
|
"itemtype": "method",
|
|
@@ -8873,7 +8873,7 @@
|
|
|
8873
8873
|
},
|
|
8874
8874
|
{
|
|
8875
8875
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
8876
|
-
"line":
|
|
8876
|
+
"line": 352,
|
|
8877
8877
|
"access": "private",
|
|
8878
8878
|
"tagname": "",
|
|
8879
8879
|
"itemtype": "property",
|
|
@@ -8883,7 +8883,7 @@
|
|
|
8883
8883
|
},
|
|
8884
8884
|
{
|
|
8885
8885
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
8886
|
-
"line":
|
|
8886
|
+
"line": 361,
|
|
8887
8887
|
"access": "private",
|
|
8888
8888
|
"tagname": "",
|
|
8889
8889
|
"itemtype": "method",
|
|
@@ -8893,7 +8893,7 @@
|
|
|
8893
8893
|
},
|
|
8894
8894
|
{
|
|
8895
8895
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
8896
|
-
"line":
|
|
8896
|
+
"line": 369,
|
|
8897
8897
|
"description": "Returns a hash containing the parameters of an ancestor route.\n\nYou may notice that `this.paramsFor` sometimes works when referring to a\nchild route, but this behavior should not be relied upon as only ancestor\nroutes are certain to be loaded in time.\n\nExample\n\n```app/router.js\n// ...\n\nRouter.map(function() {\n this.route('member', { path: ':name' }, function() {\n this.route('interest', { path: ':interest' });\n });\n});\n```\n\n```app/routes/member.js\nimport Route from '@ember/routing/route';\n\nexport default class MemberRoute extends Route {\n queryParams = {\n memberQp: { refreshModel: true }\n }\n}\n```\n\n```app/routes/member/interest.js\nimport Route from '@ember/routing/route';\n\nexport default class MemberInterestRoute extends Route {\n queryParams = {\n interestQp: { refreshModel: true }\n }\n\n model() {\n return this.paramsFor('member');\n }\n}\n```\n\nIf we visit `/turing/maths?memberQp=member&interestQp=interest` the model for\nthe `member.interest` route is a hash with:\n\n* `name`: `turing`\n* `memberQp`: `member`",
|
|
8898
8898
|
"itemtype": "method",
|
|
8899
8899
|
"name": "paramsFor",
|
|
@@ -8916,7 +8916,7 @@
|
|
|
8916
8916
|
},
|
|
8917
8917
|
{
|
|
8918
8918
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
8919
|
-
"line":
|
|
8919
|
+
"line": 448,
|
|
8920
8920
|
"description": "Serializes the query parameter key",
|
|
8921
8921
|
"itemtype": "method",
|
|
8922
8922
|
"name": "serializeQueryParamKey",
|
|
@@ -8934,7 +8934,7 @@
|
|
|
8934
8934
|
},
|
|
8935
8935
|
{
|
|
8936
8936
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
8937
|
-
"line":
|
|
8937
|
+
"line": 459,
|
|
8938
8938
|
"description": "Serializes value of the query parameter based on defaultValueType",
|
|
8939
8939
|
"itemtype": "method",
|
|
8940
8940
|
"name": "serializeQueryParam",
|
|
@@ -8962,7 +8962,7 @@
|
|
|
8962
8962
|
},
|
|
8963
8963
|
{
|
|
8964
8964
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
8965
|
-
"line":
|
|
8965
|
+
"line": 475,
|
|
8966
8966
|
"description": "Deserializes value of the query parameter based on defaultValueType",
|
|
8967
8967
|
"itemtype": "method",
|
|
8968
8968
|
"name": "deserializeQueryParam",
|
|
@@ -8990,7 +8990,7 @@
|
|
|
8990
8990
|
},
|
|
8991
8991
|
{
|
|
8992
8992
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
8993
|
-
"line":
|
|
8993
|
+
"line": 491,
|
|
8994
8994
|
"access": "private",
|
|
8995
8995
|
"tagname": "",
|
|
8996
8996
|
"itemtype": "property",
|
|
@@ -9000,7 +9000,7 @@
|
|
|
9000
9000
|
},
|
|
9001
9001
|
{
|
|
9002
9002
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9003
|
-
"line":
|
|
9003
|
+
"line": 507,
|
|
9004
9004
|
"description": "A hook you can use to reset controller values either when the model\nchanges or the route is exiting.\n\n```app/routes/articles.js\nimport Route from '@ember/routing/route';\n\nexport default class ArticlesRoute extends Route {\n resetController(controller, isExiting, transition) {\n if (isExiting && transition.targetName !== 'error') {\n controller.set('page', 1);\n }\n }\n}\n```",
|
|
9005
9005
|
"itemtype": "method",
|
|
9006
9006
|
"name": "resetController",
|
|
@@ -9029,7 +9029,7 @@
|
|
|
9029
9029
|
},
|
|
9030
9030
|
{
|
|
9031
9031
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9032
|
-
"line":
|
|
9032
|
+
"line": 534,
|
|
9033
9033
|
"access": "private",
|
|
9034
9034
|
"tagname": "",
|
|
9035
9035
|
"itemtype": "method",
|
|
@@ -9039,7 +9039,7 @@
|
|
|
9039
9039
|
},
|
|
9040
9040
|
{
|
|
9041
9041
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9042
|
-
"line":
|
|
9042
|
+
"line": 545,
|
|
9043
9043
|
"access": "private",
|
|
9044
9044
|
"tagname": "",
|
|
9045
9045
|
"itemtype": "method",
|
|
@@ -9050,7 +9050,7 @@
|
|
|
9050
9050
|
},
|
|
9051
9051
|
{
|
|
9052
9052
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9053
|
-
"line":
|
|
9053
|
+
"line": 558,
|
|
9054
9054
|
"access": "private",
|
|
9055
9055
|
"tagname": "",
|
|
9056
9056
|
"itemtype": "method",
|
|
@@ -9060,7 +9060,7 @@
|
|
|
9060
9060
|
},
|
|
9061
9061
|
{
|
|
9062
9062
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9063
|
-
"line":
|
|
9063
|
+
"line": 569,
|
|
9064
9064
|
"description": "The `willTransition` action is fired at the beginning of any\nattempted transition with a `Transition` object as the sole\nargument. This action can be used for aborting, redirecting,\nor decorating the transition from the currently active routes.\n\nA good example is preventing navigation when a form is\nhalf-filled out:\n\n```app/routes/contact-form.js\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ContactFormRoute extends Route {\n @action\n willTransition(transition) {\n if (this.controller.get('userHasEnteredData')) {\n this.controller.displayNavigationConfirm();\n transition.abort();\n }\n }\n}\n```\n\nYou can also redirect elsewhere by calling\n`this.transitionTo('elsewhere')` from within `willTransition`.\nNote that `willTransition` will not be fired for the\nredirecting `transitionTo`, since `willTransition` doesn't\nfire when there is already a transition underway. If you want\nsubsequent `willTransition` actions to fire for the redirecting\ntransition, you must first explicitly call\n`transition.abort()`.\n\nTo allow the `willTransition` event to continue bubbling to the parent\nroute, use `return true;`. When the `willTransition` method has a\nreturn value of `true` then the parent route's `willTransition` method\nwill be fired, enabling \"bubbling\" behavior for the event.",
|
|
9065
9065
|
"itemtype": "event",
|
|
9066
9066
|
"name": "willTransition",
|
|
@@ -9079,7 +9079,7 @@
|
|
|
9079
9079
|
},
|
|
9080
9080
|
{
|
|
9081
9081
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9082
|
-
"line":
|
|
9082
|
+
"line": 613,
|
|
9083
9083
|
"description": "The `didTransition` action is fired after a transition has\nsuccessfully been completed. This occurs after the normal model\nhooks (`beforeModel`, `model`, `afterModel`, `setupController`)\nhave resolved. The `didTransition` action has no arguments,\nhowever, it can be useful for tracking page views or resetting\nstate on the controller.\n\n```app/routes/login.js\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class LoginRoute extends Route {\n @action\n didTransition() {\n this.controller.get('errors.base').clear();\n return true; // Bubble the didTransition event\n }\n}\n```",
|
|
9084
9084
|
"itemtype": "event",
|
|
9085
9085
|
"name": "didTransition",
|
|
@@ -9091,7 +9091,7 @@
|
|
|
9091
9091
|
},
|
|
9092
9092
|
{
|
|
9093
9093
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9094
|
-
"line":
|
|
9094
|
+
"line": 639,
|
|
9095
9095
|
"description": "The `loading` action is fired on the route when a route's `model`\nhook returns a promise that is not already resolved. The current\n`Transition` object is the first parameter and the route that\ntriggered the loading event is the second parameter.\n\n```app/routes/application.js\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n @action\n loading(transition, route) {\n let controller = this.controllerFor('foo');\n\n // The controller may not be instantiated when initially loading\n if (controller) {\n controller.currentlyLoading = true;\n\n transition.finally(function() {\n controller.currentlyLoading = false;\n });\n }\n }\n}\n```",
|
|
9096
9096
|
"itemtype": "event",
|
|
9097
9097
|
"name": "loading",
|
|
@@ -9115,7 +9115,7 @@
|
|
|
9115
9115
|
},
|
|
9116
9116
|
{
|
|
9117
9117
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9118
|
-
"line":
|
|
9118
|
+
"line": 673,
|
|
9119
9119
|
"description": "When attempting to transition into a route, any of the hooks\nmay return a promise that rejects, at which point an `error`\naction will be fired on the partially-entered routes, allowing\nfor per-route error handling logic, or shared error handling\nlogic defined on a parent route.\n\nHere is an example of an error handler that will be invoked\nfor rejected promises from the various hooks on the route,\nas well as any unhandled errors from child routes:\n\n```app/routes/admin.js\nimport { reject } from 'rsvp';\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class AdminRoute extends Route {\n beforeModel() {\n return reject('bad things!');\n }\n\n @action\n error(error, transition) {\n // Assuming we got here due to the error in `beforeModel`,\n // we can expect that error === \"bad things!\",\n // but a promise model rejecting would also\n // call this hook, as would any errors encountered\n // in `afterModel`.\n\n // The `error` hook is also provided the failed\n // `transition`, which can be stored and later\n // `.retry()`d if desired.\n\n this.transitionTo('login');\n }\n}\n```\n\n`error` actions that bubble up all the way to `ApplicationRoute`\nwill fire a default error handler that logs the error. You can\nspecify your own global default error handler by overriding the\n`error` handler on `ApplicationRoute`:\n\n```app/routes/application.js\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n @action\n error(error, transition) {\n this.controllerFor('banner').displayError(error.message);\n }\n}\n```",
|
|
9120
9120
|
"itemtype": "event",
|
|
9121
9121
|
"name": "error",
|
|
@@ -9139,7 +9139,7 @@
|
|
|
9139
9139
|
},
|
|
9140
9140
|
{
|
|
9141
9141
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9142
|
-
"line":
|
|
9142
|
+
"line": 734,
|
|
9143
9143
|
"description": "This event is triggered when the router enters the route. It is\nnot executed when the model for the route changes.\n\n```app/routes/application.js\nimport { on } from '@ember/object/evented';\nimport Route from '@ember/routing/route';\n\nexport default Route.extend({\n collectAnalytics: on('activate', function(){\n collectAnalytics();\n })\n});\n```",
|
|
9144
9144
|
"itemtype": "event",
|
|
9145
9145
|
"name": "activate",
|
|
@@ -9151,7 +9151,7 @@
|
|
|
9151
9151
|
},
|
|
9152
9152
|
{
|
|
9153
9153
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9154
|
-
"line":
|
|
9154
|
+
"line": 754,
|
|
9155
9155
|
"description": "This event is triggered when the router completely exits this\nroute. It is not executed when the model for the route changes.\n\n```app/routes/index.js\nimport { on } from '@ember/object/evented';\nimport Route from '@ember/routing/route';\n\nexport default Route.extend({\n trackPageLeaveAnalytics: on('deactivate', function(){\n trackPageLeaveAnalytics();\n })\n});\n```",
|
|
9156
9156
|
"itemtype": "event",
|
|
9157
9157
|
"name": "deactivate",
|
|
@@ -9163,7 +9163,7 @@
|
|
|
9163
9163
|
},
|
|
9164
9164
|
{
|
|
9165
9165
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9166
|
-
"line":
|
|
9166
|
+
"line": 774,
|
|
9167
9167
|
"description": "This hook is executed when the router completely exits this route. It is\nnot executed when the model for the route changes.",
|
|
9168
9168
|
"itemtype": "method",
|
|
9169
9169
|
"name": "deactivate",
|
|
@@ -9182,7 +9182,7 @@
|
|
|
9182
9182
|
},
|
|
9183
9183
|
{
|
|
9184
9184
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9185
|
-
"line":
|
|
9185
|
+
"line": 785,
|
|
9186
9186
|
"description": "This hook is executed when the router enters the route. It is not executed\nwhen the model for the route changes.",
|
|
9187
9187
|
"itemtype": "method",
|
|
9188
9188
|
"name": "activate",
|
|
@@ -9201,7 +9201,7 @@
|
|
|
9201
9201
|
},
|
|
9202
9202
|
{
|
|
9203
9203
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9204
|
-
"line":
|
|
9204
|
+
"line": 796,
|
|
9205
9205
|
"description": "Transition the application into another route. The route may\nbe either a single route or route path:\n\n```javascript\nthis.transitionTo('blogPosts');\nthis.transitionTo('blogPosts.recentEntries');\n```\n\nOptionally supply a model for the route in question. The model\nwill be serialized into the URL using the `serialize` hook of\nthe route:\n\n```javascript\nthis.transitionTo('blogPost', aPost);\n```\n\nIf a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the `model`\nhook of the route will be triggered:\n\n```javascript\nthis.transitionTo('blogPost', 1);\n```\n\nMultiple models will be applied last to first recursively up the\nroute tree.\n\n```app/routes.js\n// ...\n\nRouter.map(function() {\n this.route('blogPost', { path:':blogPostId' }, function() {\n this.route('blogComment', { path: ':blogCommentId' });\n });\n});\n\nexport default Router;\n```\n\n```javascript\nthis.transitionTo('blogComment', aPost, aComment);\nthis.transitionTo('blogComment', 1, 13);\n```\n\nIt is also possible to pass a URL (a string that starts with a\n`/`).\n\n```javascript\nthis.transitionTo('/');\nthis.transitionTo('/blog/post/1/comment/13');\nthis.transitionTo('/blog/posts?sort=title');\n```\n\nAn options hash with a `queryParams` property may be provided as\nthe final argument to add query parameters to the destination URL.\n\n```javascript\nthis.transitionTo('blogPost', 1, {\n queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\nthis.transitionTo({ queryParams: { sort: 'date' } });\n```\n\nSee also [replaceWith](#method_replaceWith).\n\nSimple Transition Example\n\n```app/routes.js\n// ...\n\nRouter.map(function() {\n this.route('index');\n this.route('secret');\n this.route('fourOhFour', { path: '*:' });\n});\n\nexport default Router;\n```\n\n```app/routes/index.js\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n @action\n moveToSecret(context) {\n if (authorized()) {\n this.transitionTo('secret', context);\n } else {\n this.transitionTo('fourOhFour');\n }\n }\n}\n```\n\nTransition to a nested route\n\n```app/router.js\n// ...\n\nRouter.map(function() {\n this.route('articles', { path: '/articles' }, function() {\n this.route('new');\n });\n});\n\nexport default Router;\n```\n\n```app/routes/index.js\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n @action\n transitionToNewArticle() {\n this.transitionTo('articles.new');\n }\n}\n```\n\nMultiple Models Example\n\n```app/router.js\n// ...\n\nRouter.map(function() {\n this.route('index');\n\n this.route('breakfast', { path: ':breakfastId' }, function() {\n this.route('cereal', { path: ':cerealId' });\n });\n});\n\nexport default Router;\n```\n\n```app/routes/index.js\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n @action\n moveToChocolateCereal() {\n let cereal = { cerealId: 'ChocolateYumminess' };\n let breakfast = { breakfastId: 'CerealAndMilk' };\n\n this.transitionTo('breakfast.cereal', breakfast, cereal);\n }\n}\n```\n\nNested Route with Query String Example\n\n```app/routes.js\n// ...\n\nRouter.map(function() {\n this.route('fruits', function() {\n this.route('apples');\n });\n});\n\nexport default Router;\n```\n\n```app/routes/index.js\nimport Route from '@ember/routing/route';\n\nexport default class IndexRoute extends Route {\n @action\n transitionToApples() {\n this.transitionTo('fruits.apples', { queryParams: { color: 'red' } });\n }\n}\n```",
|
|
9206
9206
|
"itemtype": "method",
|
|
9207
9207
|
"name": "transitionTo",
|
|
@@ -9239,7 +9239,7 @@
|
|
|
9239
9239
|
},
|
|
9240
9240
|
{
|
|
9241
9241
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9242
|
-
"line":
|
|
9242
|
+
"line": 994,
|
|
9243
9243
|
"description": "Perform a synchronous transition into another route without attempting\nto resolve promises, update the URL, or abort any currently active\nasynchronous transitions (i.e. regular transitions caused by\n`transitionTo` or URL changes).\n\nThis method is handy for performing intermediate transitions on the\nway to a final destination route, and is called internally by the\ndefault implementations of the `error` and `loading` handlers.",
|
|
9244
9244
|
"itemtype": "method",
|
|
9245
9245
|
"name": "intermediateTransitionTo",
|
|
@@ -9263,7 +9263,7 @@
|
|
|
9263
9263
|
},
|
|
9264
9264
|
{
|
|
9265
9265
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9266
|
-
"line":
|
|
9266
|
+
"line": 1016,
|
|
9267
9267
|
"description": "Refresh the model on this route and any child routes, firing the\n`beforeModel`, `model`, and `afterModel` hooks in a similar fashion\nto how routes are entered when transitioning in from other route.\nThe current route params (e.g. `article_id`) will be passed in\nto the respective model hooks, and if a different model is returned,\n`setupController` and associated route hooks will re-fire as well.\n\nAn example usage of this method is re-querying the server for the\nlatest information using the same parameters as when the route\nwas first entered.\n\nNote that this will cause `model` hooks to fire even on routes\nthat were provided a model object when the route was initially\nentered.",
|
|
9268
9268
|
"itemtype": "method",
|
|
9269
9269
|
"name": "refresh",
|
|
@@ -9279,7 +9279,7 @@
|
|
|
9279
9279
|
},
|
|
9280
9280
|
{
|
|
9281
9281
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9282
|
-
"line":
|
|
9282
|
+
"line": 1042,
|
|
9283
9283
|
"description": "Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to `transitionTo` in all other respects. See\n'transitionTo' for additional information regarding multiple models.\n\nExample\n\n```app/router.js\n// ...\n\nRouter.map(function() {\n this.route('index');\n this.route('secret');\n});\n\nexport default Router;\n```\n\n```app/routes/secret.js\nimport Route from '@ember/routing/route';\n\nexport default class SecretRoute Route {\n afterModel() {\n if (!authorized()){\n this.replaceWith('index');\n }\n }\n}\n```",
|
|
9284
9284
|
"itemtype": "method",
|
|
9285
9285
|
"name": "replaceWith",
|
|
@@ -9315,7 +9315,7 @@
|
|
|
9315
9315
|
},
|
|
9316
9316
|
{
|
|
9317
9317
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9318
|
-
"line":
|
|
9318
|
+
"line": 1090,
|
|
9319
9319
|
"description": "This hook is the entry point for router.js",
|
|
9320
9320
|
"access": "private",
|
|
9321
9321
|
"tagname": "",
|
|
@@ -9326,7 +9326,7 @@
|
|
|
9326
9326
|
},
|
|
9327
9327
|
{
|
|
9328
9328
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9329
|
-
"line":
|
|
9329
|
+
"line": 1170,
|
|
9330
9330
|
"description": "This hook is the first of the route entry validation hooks\ncalled when an attempt is made to transition into a route\nor one of its children. It is called before `model` and\n`afterModel`, and is appropriate for cases when:\n\n1) A decision can be made to redirect elsewhere without\n needing to resolve the model first.\n2) Any async operations need to occur first before the\n model is attempted to be resolved.\n\nThis hook is provided the current `transition` attempt\nas a parameter, which can be used to `.abort()` the transition,\nsave it for a later `.retry()`, or retrieve values set\non it from a previous hook. You can also just call\n`this.transitionTo` to another route to implicitly\nabort the `transition`.\n\nYou can return a promise from this hook to pause the\ntransition until the promise resolves (or rejects). This could\nbe useful, for instance, for retrieving async code from\nthe server that is required to enter a route.",
|
|
9331
9331
|
"itemtype": "method",
|
|
9332
9332
|
"name": "beforeModel",
|
|
@@ -9349,7 +9349,7 @@
|
|
|
9349
9349
|
},
|
|
9350
9350
|
{
|
|
9351
9351
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9352
|
-
"line":
|
|
9352
|
+
"line": 1204,
|
|
9353
9353
|
"description": "This hook is called after this route's model has resolved.\nIt follows identical async/promise semantics to `beforeModel`\nbut is provided the route's resolved model in addition to\nthe `transition`, and is therefore suited to performing\nlogic that can only take place after the model has already\nresolved.\n\n```app/routes/posts.js\nimport Route from '@ember/routing/route';\n\nexport default class PostsRoute extends Route {\n afterModel(posts, transition) {\n if (posts.get('length') === 1) {\n this.transitionTo('post.show', posts.get('firstObject'));\n }\n }\n}\n```\n\nRefer to documentation for `beforeModel` for a description\nof transition-pausing semantics when a promise is returned\nfrom this hook.",
|
|
9354
9354
|
"itemtype": "method",
|
|
9355
9355
|
"name": "afterModel",
|
|
@@ -9377,7 +9377,7 @@
|
|
|
9377
9377
|
},
|
|
9378
9378
|
{
|
|
9379
9379
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9380
|
-
"line":
|
|
9380
|
+
"line": 1241,
|
|
9381
9381
|
"description": "A hook you can implement to optionally redirect to another route.\n\nCalling `this.transitionTo` from inside of the `redirect` hook will\nabort the current transition (into the route that has implemented `redirect`).\n\n`redirect` and `afterModel` behave very similarly and are\ncalled almost at the same time, but they have an important\ndistinction when calling `this.transitionTo` to a child route\nof the current route. From `afterModel`, this new transition\ninvalidates the current transition, causing `beforeModel`,\n`model`, and `afterModel` hooks to be called again. But the\nsame transition started from `redirect` does _not_ invalidate\nthe current transition. In other words, by the time the `redirect`\nhook has been called, both the resolved model and the attempted\nentry into this route are considered fully validated.",
|
|
9382
9382
|
"itemtype": "method",
|
|
9383
9383
|
"name": "redirect",
|
|
@@ -9401,7 +9401,7 @@
|
|
|
9401
9401
|
},
|
|
9402
9402
|
{
|
|
9403
9403
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9404
|
-
"line":
|
|
9404
|
+
"line": 1266,
|
|
9405
9405
|
"description": "Called when the context is changed by router.js.",
|
|
9406
9406
|
"access": "private",
|
|
9407
9407
|
"tagname": "",
|
|
@@ -9412,7 +9412,7 @@
|
|
|
9412
9412
|
},
|
|
9413
9413
|
{
|
|
9414
9414
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9415
|
-
"line":
|
|
9415
|
+
"line": 1276,
|
|
9416
9416
|
"description": "A hook you can implement to convert the URL into the model for\nthis route.\n\n```app/router.js\n// ...\n\nRouter.map(function() {\n this.route('post', { path: '/posts/:post_id' });\n});\n\nexport default Router;\n```\n\nThe model for the `post` route is `store.findRecord('post', params.post_id)`.\n\nBy default, if your route has a dynamic segment ending in `_id`:\n\n* The model class is determined from the segment (`post_id`'s\n class is `App.Post`)\n* The find method is called on the model class with the value of\n the dynamic segment.\n\nNote that for routes with dynamic segments, this hook is not always\nexecuted. If the route is entered through a transition (e.g. when\nusing the `link-to` Handlebars helper or the `transitionTo` method\nof routes), and a model context is already provided this hook\nis not called.\n\nA model context does not include a primitive string or number,\nwhich does cause the model hook to be called.\n\nRoutes without dynamic segments will always execute the model hook.\n\n```javascript\n// no dynamic segment, model hook always called\nthis.transitionTo('posts');\n\n// model passed in, so model hook not called\nthePost = store.findRecord('post', 1);\nthis.transitionTo('post', thePost);\n\n// integer passed in, model hook is called\nthis.transitionTo('post', 1);\n\n// model id passed in, model hook is called\n// useful for forcing the hook to execute\nthePost = store.findRecord('post', 1);\nthis.transitionTo('post', thePost.id);\n```\n\nThis hook follows the asynchronous/promise semantics\ndescribed in the documentation for `beforeModel`. In particular,\nif a promise returned from `model` fails, the error will be\nhandled by the `error` hook on `Route`.\n\nExample\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n model(params) {\n return this.store.findRecord('post', params.post_id);\n }\n}\n```",
|
|
9417
9417
|
"itemtype": "method",
|
|
9418
9418
|
"name": "model",
|
|
@@ -9440,7 +9440,7 @@
|
|
|
9440
9440
|
},
|
|
9441
9441
|
{
|
|
9442
9442
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9443
|
-
"line":
|
|
9443
|
+
"line": 1385,
|
|
9444
9444
|
"access": "private",
|
|
9445
9445
|
"tagname": "",
|
|
9446
9446
|
"itemtype": "method",
|
|
@@ -9466,7 +9466,7 @@
|
|
|
9466
9466
|
},
|
|
9467
9467
|
{
|
|
9468
9468
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9469
|
-
"line":
|
|
9469
|
+
"line": 1398,
|
|
9470
9470
|
"itemtype": "method",
|
|
9471
9471
|
"name": "findModel",
|
|
9472
9472
|
"params": [
|
|
@@ -9488,7 +9488,7 @@
|
|
|
9488
9488
|
},
|
|
9489
9489
|
{
|
|
9490
9490
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9491
|
-
"line":
|
|
9491
|
+
"line": 1409,
|
|
9492
9492
|
"description": "A hook you can use to setup the controller for the current route.\n\nThis method is called with the controller for the current route and the\nmodel supplied by the `model` hook.\n\nBy default, the `setupController` hook sets the `model` property of\nthe controller to the specified `model` when it is not `undefined`.\n\nIf you implement the `setupController` hook in your Route, it will\nprevent this default behavior. If you want to preserve that behavior\nwhen implementing your `setupController` function, make sure to call\n`super`:\n\n```app/routes/photos.js\nimport Route from '@ember/routing/route';\n\nexport default class PhotosRoute extends Route {\n model() {\n return this.store.findAll('photo');\n }\n\n setupController(controller, model) {\n super.setupController(controller, model);\n\n this.controllerFor('application').set('showingPhotos', true);\n }\n}\n```\n\nThe provided controller will be one resolved based on the name\nof this route.\n\nIf no explicit controller is defined, Ember will automatically create one.\n\nAs an example, consider the router:\n\n```app/router.js\n// ...\n\nRouter.map(function() {\n this.route('post', { path: '/posts/:post_id' });\n});\n\nexport default Router;\n```\n\nIf you have defined a file for the post controller,\nthe framework will use it.\nIf it is not defined, a basic `Controller` instance would be used.",
|
|
9493
9493
|
"example": [
|
|
9494
9494
|
" Behavior of a basic Controller\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n setupController(controller, model) {\n controller.set('model', model);\n }\n});\n```"
|
|
@@ -9521,7 +9521,7 @@
|
|
|
9521
9521
|
},
|
|
9522
9522
|
{
|
|
9523
9523
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9524
|
-
"line":
|
|
9524
|
+
"line": 1486,
|
|
9525
9525
|
"description": "Returns the controller of the current route, or a parent (or any ancestor)\nroute in a route hierarchy.\n\nThe controller instance must already have been created, either through entering the\nassociated route or using `generateController`.\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n setupController(controller, post) {\n super.setupController(controller, post);\n\n this.controllerFor('posts').set('currentPost', post);\n }\n}\n```",
|
|
9526
9526
|
"itemtype": "method",
|
|
9527
9527
|
"name": "controllerFor",
|
|
@@ -9544,7 +9544,7 @@
|
|
|
9544
9544
|
},
|
|
9545
9545
|
{
|
|
9546
9546
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9547
|
-
"line":
|
|
9547
|
+
"line": 1532,
|
|
9548
9548
|
"description": "Generates a controller for a route.\n\nExample\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\n\nexport default class Post extends Route {\n setupController(controller, post) {\n super.setupController(controller, post);\n\n this.generateController('posts');\n }\n}\n```",
|
|
9549
9549
|
"itemtype": "method",
|
|
9550
9550
|
"name": "generateController",
|
|
@@ -9562,7 +9562,7 @@
|
|
|
9562
9562
|
},
|
|
9563
9563
|
{
|
|
9564
9564
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9565
|
-
"line":
|
|
9565
|
+
"line": 1559,
|
|
9566
9566
|
"description": "Returns the resolved model of a parent (or any ancestor) route\nin a route hierarchy. During a transition, all routes\nmust resolve a model object, and if a route\nneeds access to a parent route's model in order to\nresolve a model (or just reuse the model from a parent),\nit can call `this.modelFor(theNameOfParentRoute)` to\nretrieve it. If the ancestor route's model was a promise,\nits resolved result is returned.\n\nExample\n\n```app/router.js\n// ...\n\nRouter.map(function() {\n this.route('post', { path: '/posts/:post_id' }, function() {\n this.route('comments');\n });\n});\n\nexport default Router;\n```\n\n```app/routes/post/comments.js\nimport Route from '@ember/routing/route';\n\nexport default class PostCommentsRoute extends Route {\n model() {\n let post = this.modelFor('post');\n\n return post.comments;\n }\n}\n```",
|
|
9567
9567
|
"itemtype": "method",
|
|
9568
9568
|
"name": "modelFor",
|
|
@@ -9585,7 +9585,7 @@
|
|
|
9585
9585
|
},
|
|
9586
9586
|
{
|
|
9587
9587
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9588
|
-
"line":
|
|
9588
|
+
"line": 1630,
|
|
9589
9589
|
"description": "`this[RENDER]` is used to render a template into a region of another template\n(indicated by an `{{outlet}}`).",
|
|
9590
9590
|
"itemtype": "method",
|
|
9591
9591
|
"name": "this[RENDER]",
|
|
@@ -9635,7 +9635,7 @@
|
|
|
9635
9635
|
},
|
|
9636
9636
|
{
|
|
9637
9637
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9638
|
-
"line":
|
|
9638
|
+
"line": 1657,
|
|
9639
9639
|
"access": "private",
|
|
9640
9640
|
"tagname": "",
|
|
9641
9641
|
"itemtype": "method",
|
|
@@ -9645,7 +9645,7 @@
|
|
|
9645
9645
|
},
|
|
9646
9646
|
{
|
|
9647
9647
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9648
|
-
"line":
|
|
9648
|
+
"line": 1670,
|
|
9649
9649
|
"description": "Allows you to produce custom metadata for the route.\nThe return value of this method will be attached to\nits corresponding RouteInfoWithAttributes object.\n\nExample\n\n```app/routes/posts/index.js\nimport Route from '@ember/routing/route';\n\nexport default class PostsIndexRoute extends Route {\n buildRouteInfoMetadata() {\n return { title: 'Posts Page' }\n }\n}\n```\n\n```app/routes/application.js\nimport Route from '@ember/routing/route';\nimport { service } from '@ember/service';\n\nexport default class ApplicationRoute extends Route {\n @service router\n\n constructor() {\n super(...arguments);\n\n this.router.on('routeDidChange', transition => {\n document.title = transition.to.metadata.title;\n // would update document's title to \"Posts Page\"\n });\n }\n}\n```",
|
|
9650
9650
|
"itemtype": "method",
|
|
9651
9651
|
"name": "buildRouteInfoMetadata",
|
|
@@ -9660,7 +9660,7 @@
|
|
|
9660
9660
|
},
|
|
9661
9661
|
{
|
|
9662
9662
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9663
|
-
"line":
|
|
9663
|
+
"line": 1720,
|
|
9664
9664
|
"description": "Store property provides a hook for data persistence libraries to inject themselves.\n\nBy default, this store property provides the exact same functionality previously\nin the model hook.\n\nCurrently, the required interface is:\n\n`store.find(modelName, findArguments)`",
|
|
9665
9665
|
"itemtype": "property",
|
|
9666
9666
|
"name": "store",
|
|
@@ -9672,7 +9672,7 @@
|
|
|
9672
9672
|
},
|
|
9673
9673
|
{
|
|
9674
9674
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9675
|
-
"line":
|
|
9675
|
+
"line": 1785,
|
|
9676
9676
|
"access": "private",
|
|
9677
9677
|
"tagname": "",
|
|
9678
9678
|
"itemtype": "property",
|
|
@@ -9682,7 +9682,7 @@
|
|
|
9682
9682
|
},
|
|
9683
9683
|
{
|
|
9684
9684
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9685
|
-
"line":
|
|
9685
|
+
"line": 1915,
|
|
9686
9686
|
"description": "Sends an action to the router, which will delegate it to the currently\nactive route hierarchy per the bubbling rules explained under `actions`.\n\nExample\n\n```app/router.js\n// ...\n\nRouter.map(function() {\n this.route('index');\n});\n\nexport default Router;\n```\n\n```app/routes/application.js\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n @action\n track(arg) {\n console.log(arg, 'was clicked');\n }\n}\n```\n\n```app/routes/index.js\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n @action\n trackIfDebug(arg) {\n if (debug) {\n this.send('track', arg);\n }\n }\n}\n```",
|
|
9687
9687
|
"itemtype": "method",
|
|
9688
9688
|
"name": "send",
|
|
@@ -9706,7 +9706,7 @@
|
|
|
9706
9706
|
},
|
|
9707
9707
|
{
|
|
9708
9708
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9709
|
-
"line":
|
|
9709
|
+
"line": 2242,
|
|
9710
9710
|
"description": "A hook you can implement to convert the route's model into parameters\nfor the URL.\n\n```app/router.js\n// ...\n\nRouter.map(function() {\n this.route('post', { path: '/posts/:post_id' });\n});\n\n```\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n model({ post_id }) {\n // the server returns `{ id: 12 }`\n return fetch(`/posts/${post_id}`;\n }\n\n serialize(model) {\n // this will make the URL `/posts/12`\n return { post_id: model.id };\n }\n}\n```\n\nThe default `serialize` method will insert the model's `id` into the\nroute's dynamic segment (in this case, `:post_id`) if the segment contains '_id'.\nIf the route has multiple dynamic segments or does not contain '_id', `serialize`\nwill return `getProperties(model, params)`\n\nThis method is called when `transitionTo` is called with a context\nin order to populate the URL.",
|
|
9711
9711
|
"itemtype": "method",
|
|
9712
9712
|
"name": "serialize",
|
|
@@ -9734,7 +9734,7 @@
|
|
|
9734
9734
|
},
|
|
9735
9735
|
{
|
|
9736
9736
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9737
|
-
"line":
|
|
9737
|
+
"line": 2312,
|
|
9738
9738
|
"description": "The controller associated with this route.\n\nExample\n\n```app/routes/form.js\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class FormRoute extends Route {\n @action\n willTransition(transition) {\n if (this.controller.get('userHasEnteredData') &&\n !confirm('Are you sure you want to abandon progress?')) {\n transition.abort();\n } else {\n // Bubble the `willTransition` action so that\n // parent routes can decide whether or not to abort.\n return true;\n }\n }\n}\n```",
|
|
9739
9739
|
"itemtype": "property",
|
|
9740
9740
|
"name": "controller",
|
|
@@ -9747,7 +9747,7 @@
|
|
|
9747
9747
|
},
|
|
9748
9748
|
{
|
|
9749
9749
|
"file": "packages/@ember/-internals/routing/lib/system/route.ts",
|
|
9750
|
-
"line":
|
|
9750
|
+
"line": 2343,
|
|
9751
9751
|
"description": "This action is called when one or more query params have changed. Bubbles.",
|
|
9752
9752
|
"itemtype": "method",
|
|
9753
9753
|
"name": "queryParamsDidChange",
|
|
@@ -18008,7 +18008,7 @@
|
|
|
18008
18008
|
},
|
|
18009
18009
|
{
|
|
18010
18010
|
"message": "replacing incorrect tag: returns with return",
|
|
18011
|
-
"line": " packages/@ember/-internals/routing/lib/system/route.ts:
|
|
18011
|
+
"line": " packages/@ember/-internals/routing/lib/system/route.ts:2343"
|
|
18012
18012
|
},
|
|
18013
18013
|
{
|
|
18014
18014
|
"message": "replacing incorrect tag: function with method",
|
package/lib/browsers.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
module.exports = [
|
|
2
|
+
'Chrome >= 92',
|
|
3
|
+
'Edge >= 93',
|
|
4
|
+
'Firefox >= 91',
|
|
5
|
+
'iOS >= 12',
|
|
6
|
+
'Safari >= 12',
|
|
7
|
+
'ChromeAndroid >= 96',
|
|
8
|
+
'FirefoxAndroid >= 94',
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
As of the release of 4.0.0, the above query expands to:
|
|
13
|
+
|
|
14
|
+
and_chr 96
|
|
15
|
+
and_ff 94
|
|
16
|
+
chrome 96
|
|
17
|
+
chrome 95
|
|
18
|
+
chrome 94
|
|
19
|
+
chrome 93
|
|
20
|
+
chrome 92
|
|
21
|
+
chrome 91
|
|
22
|
+
chrome 87
|
|
23
|
+
edge 96
|
|
24
|
+
edge 95
|
|
25
|
+
firefox 95
|
|
26
|
+
firefox 94
|
|
27
|
+
firefox 93
|
|
28
|
+
firefox 60
|
|
29
|
+
firefox 52
|
|
30
|
+
ios_saf 15.2
|
|
31
|
+
ios_saf 15.0-15.1
|
|
32
|
+
ios_saf 14.5-14.8
|
|
33
|
+
ios_saf 14.0-14.4
|
|
34
|
+
ios_saf 13.4-13.7
|
|
35
|
+
ios_saf 13.3
|
|
36
|
+
ios_saf 13.2
|
|
37
|
+
ios_saf 13.0-13.1
|
|
38
|
+
ios_saf 12.2-12.5
|
|
39
|
+
ios_saf 12.0-12.1
|
|
40
|
+
safari 15.2
|
|
41
|
+
safari 15.1
|
|
42
|
+
safari 15
|
|
43
|
+
safari 14.1
|
|
44
|
+
safari 14
|
|
45
|
+
safari 13.1
|
|
46
|
+
safari 13
|
|
47
|
+
safari 12.1
|
|
48
|
+
safari 12
|
|
49
|
+
|
|
50
|
+
*/
|
package/lib/index.js
CHANGED
|
@@ -11,6 +11,7 @@ const debugTree = require('broccoli-debug').buildDebugCallback('ember-source:add
|
|
|
11
11
|
const vmBabelPlugins = require('@glimmer/vm-babel-plugins');
|
|
12
12
|
const Overrides = require('./overrides');
|
|
13
13
|
const SilentError = require('silent-error');
|
|
14
|
+
const SupportedBrowsers = require('./browsers');
|
|
14
15
|
|
|
15
16
|
const PRE_BUILT_TARGETS = [
|
|
16
17
|
'last 1 Chrome versions',
|
|
@@ -59,6 +60,9 @@ module.exports = {
|
|
|
59
60
|
absolutePaths,
|
|
60
61
|
_overrideTree: undefined,
|
|
61
62
|
|
|
63
|
+
// Expose supported list of browsers for reference by other packages
|
|
64
|
+
supportedBrowsers: SupportedBrowsers,
|
|
65
|
+
|
|
62
66
|
included() {
|
|
63
67
|
this._super.included.apply(this, arguments);
|
|
64
68
|
|