You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"description": "<html><head></head><body><p>Framework objects in an Ember application (components, services, routes, etc.)\nare created via a factory and dependency injection system. Each of these\nobjects is the responsibility of an "owner", which handled its\ninstantiation and manages its lifetime.</p>\n<p><code>getOwner</code> fetches the owner object responsible for an instance. This can\nbe used to lookup or resolve other class instances, or register new factories\ninto the owner.</p>\n<p>For example, this component dynamically looks up a service based on the\n<code>audioType</code> passed as an argument:</p>\n<div class=\"highlight audio.js\">\n <div class=\"ribbon\"></div>\n <div class=\"scroller\">\n <table class=\"CodeRay\">\n <thead>\n <tr>\n <td colspan=\"2\">audio.js</td>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td class=\"line-numbers\"><pre>1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n</pre></td>\n <td class=\"code\"><pre><span class=\"keyword\">import</span> <span class=\"type\">Component</span> from '<span class=\"meta\">@glimmer</span>/component';\n<span class=\"keyword\">import</span> { action } from '<span class=\"meta\">@ember</span>/<span class=\"class\"><span class=\"keyword\">object</span>'</span>;\n<span class=\"keyword\">import</span> { getOwner } from '<span class=\"meta\">@ember</span>/application';\n\n<span class=\"comment\">// Usage:</span>\n<span class=\"comment\">//</span>\n<span class=\"comment\">// <PlayAudio @audioType={{@model.audioType}} @audioFile={{@model.file}}/></span>\n<span class=\"comment\">//</span>\nexport <span class=\"keyword\">default</span> <span class=\"class\"><span class=\"keyword\">class</span> <span class=\"keyword\">extends</span> <span class=\"title\">Component</span> </span>{\n get audioService() {\n let owner = getOwner(<span class=\"keyword\">this</span>);\n <span class=\"keyword\">return</span> owner.lookup(`service:${<span class=\"keyword\">this</span>.args.audioType}`);\n }\n\n <span class=\"meta\">@action</span>\n onPlay() {\n let player = <span class=\"keyword\">this</span>.audioService;\n player.play(<span class=\"keyword\">this</span>.args.audioFile);\n }\n}</pre></td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n \n</body></html>",
"description": "<html><head></head><body><p><code>setOwner</code> forces a new owner on a given object instance. This is primarily\nuseful in some testing cases.</p>\n</body></html>",
44
+
"itemtype": "method",
45
+
"name": "setOwner",
46
+
"static": 1,
47
+
"params": [
48
+
{
49
+
"name": "object",
50
+
"description": "An object instance.",
51
+
"type": "Object"
52
+
},
53
+
{
54
+
"name": "object",
55
+
"description": "The new owner object of the object instance.",
"description": "<html><head></head><body><p>Detects when a specific package of Ember (e.g. 'Application')\nhas fully loaded and is available for extension.</p>\n<p>The provided <code>callback</code> will be called with the <code>name</code> passed\nresolved from a string into the object:</p>\n<div class=\"highlight javascript\">\n <div class=\"ribbon\"></div>\n <div class=\"scroller\">\n <table class=\"CodeRay\">\n <tbody>\n <tr>\n <td class=\"line-numbers\"><pre>1\n2\n3\n4\n5\n</pre></td>\n <td class=\"code\"><pre><span class=\"keyword\">import</span> { onLoad } <span class=\"keyword\">from</span> <span class=\"string\">'@ember/application'</span>;\n\nonLoad(<span class=\"string\">'Ember.Application'</span> <span class=\"function\"><span class=\"keyword\">function</span>(<span class=\"params\">hbars</span>) </span>{\n hbars.registerHelper(...);\n});</pre></td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n \n</body></html>",
"description": "<html><head></head><body><p>Called when an Ember.js package (e.g Application) has finished\nloading. Triggers any callbacks registered for this event.</p>\n</body></html>",
"description": "<html><head></head><body><p>Creates an <code>Ember.NativeArray</code> from an Array-like object.\nDoes not modify the original object's contents. <code>A()</code> is not needed if\n<code>EmberENV.EXTEND_PROTOTYPES</code> is <code>true</code> (the default value). However,\nit is recommended that you use <code>A()</code> when creating addons for\nember or when you can not guarantee that <code>EmberENV.EXTEND_PROTOTYPES</code>\nwill be <code>true</code>.</p>\n<p>Example</p>\n<div class=\"highlight javascript\">\n <div class=\"ribbon\"></div>\n <div class=\"scroller\">\n <table class=\"CodeRay\">\n <thead>\n <tr>\n <td colspan=\"2\">component.js</td>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td class=\"line-numbers\"><pre>1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n</pre></td>\n <td class=\"code\"><pre><span class=\"keyword\">import</span> Component from <span class=\"string\">'@ember/component'</span>;\n<span class=\"keyword\">import</span> { A } from <span class=\"string\">'@ember/array'</span>;\n\nexport default Component.extend({\n tagName: <span class=\"string\">'ul'</span>,\n classNames: [<span class=\"string\">'pagination'</span>],\n\n <span class=\"keyword\">init</span>() {\n <span class=\"keyword\">this</span>._super(...arguments);\n\n <span class=\"keyword\">if</span> (!<span class=\"keyword\">this</span>.<span class=\"keyword\">get</span>(<span class=\"string\">'content'</span>)) {\n <span class=\"keyword\">this</span>.<span class=\"keyword\">set</span>(<span class=\"string\">'content'</span>, A());\n <span class=\"keyword\">this</span>.<span class=\"keyword\">set</span>(<span class=\"string\">'otherContent'</span>, A([<span class=\"number\">1</span>,<span class=\"number\">2</span>,<span class=\"number\">3</span>]));\n }\n }\n});</pre></td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n \n</body></html>",
41
+
"line": 1903,
42
+
"description": "<html><head></head><body><p>Creates an <code>Ember.NativeArray</code> from an Array-like object.\nDoes not modify the original object's contents. <code>A()</code> is not needed if\n<code>EmberENV.EXTEND_PROTOTYPES</code> is <code>true</code> (the default value). However,\nit is recommended that you use <code>A()</code> when creating addons for\nember or when you can not guarantee that <code>EmberENV.EXTEND_PROTOTYPES</code>\nwill be <code>true</code>.</p>\n<p>Example</p>\n<div class=\"highlight component.js\">\n <div class=\"ribbon\"></div>\n <div class=\"scroller\">\n <table class=\"CodeRay\">\n <thead>\n <tr>\n <td colspan=\"2\">component.js</td>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td class=\"line-numbers\"><pre>1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n</pre></td>\n <td class=\"code\"><pre><span class=\"keyword\">import</span> Component from <span class=\"string\">'@ember/component'</span>;\n<span class=\"keyword\">import</span> { A } from <span class=\"string\">'@ember/array'</span>;\n\nexport <span class=\"keyword\">default</span> Component.extend({\n tagName: <span class=\"string\">'ul'</span>,\n classNames: [<span class=\"string\">'pagination'</span>],\n\n <span class=\"keyword\">init</span>() {\n <span class=\"keyword\">this</span>._super(...arguments);\n\n <span class=\"keyword\">if</span> (!<span class=\"keyword\">this</span>.<span class=\"keyword\">get</span>(<span class=\"string\">'content'</span>)) {\n <span class=\"keyword\">this</span>.<span class=\"keyword\">set</span>(<span class=\"string\">'content'</span>, A());\n <span class=\"keyword\">this</span>.<span class=\"keyword\">set</span>(<span class=\"string\">'otherContent'</span>, A([<span class=\"number\">1</span>,<span class=\"number\">2</span>,<span class=\"number\">3</span>]));\n }\n }\n});</pre></td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n \n</body></html>",
0 commit comments