5 lines
30 KiB
JSON
5 lines
30 KiB
JSON
{
|
|
"id": "api/common/NgTemplateOutlet",
|
|
"title": "NgTemplateOutlet",
|
|
"contents": "\n\n<article>\n <div class=\"breadcrumb-container\">\n <div class=\"breadcrumb\">\n <script type=\"application/ld+json\">\n {\n \"@context\": \"http://schema.org\",\n \"@type\": \"BreadcrumbList\",\n \"itemListElement\": [\n { \"@type\": \"ListItem\", \"position\": 1, \"item\": { \"@id\": \"https://angular.io//api\", \"name\": \"API\" } },\n { \"@type\": \"ListItem\", \"position\": 2, \"item\": { \"@id\": \"https://angular.io/api/common\", \"name\": \"@angular/common\" } },\n { \"@type\": \"ListItem\", \"position\": 3, \"item\": { \"@id\": \"https://angular.io/api/common/NgTemplateOutlet\", \"name\": \"NgTemplateOutlet\" } }\n ]\n }\n </script>\n <a href=\"/api\">API</a> > <a href=\"api/common\">@angular/common</a>\n </div>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/common/src/directives/ng_template_outlet.ts?message=docs(common)%3A%20describe%20your%20change...#L10-L70\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n <a href=\"https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/directives/ng_template_outlet.ts#L10-L70\" aria-label=\"View Source\" title=\"View Source\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">code</i></a>\n</div>\n </div>\n \n <header class=\"api-header\">\n <h1 id=\"ngtemplateoutlet\">NgTemplateOutlet<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/NgTemplateOutlet#ngtemplateoutlet\"><i class=\"material-icons\">link</i></a></h1>\n \n <label class=\"api-type-label directive\">directive</label>\n \n \n \n </header>\n \n <aio-toc class=\"embedded\"></aio-toc>\n\n <div class=\"api-body\">\n \n <section class=\"short-description\">\n <p>Inserts an embedded view from a prepared <code><a href=\"api/core/TemplateRef\" class=\"code-anchor\">TemplateRef</a></code>.</p>\n\n <p><a href=\"api/common/NgTemplateOutlet#description\">See more...</a></p>\n </section>\n \n \n \n \n\n <h2 id=\"ngmodule\">NgModule<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/NgTemplateOutlet#ngmodule\"><i class=\"material-icons\">link</i></a></h2>\n<ul class=\"ngmodule-list\">\n\n <li>\n <a href=\"api/common/CommonModule\">\n <code-example language=\"ts\" hidecopy=\"true\" class=\"no-box\">CommonModule</code-example>\n </a>\n </li>\n \n</ul>\n\n\n \n<section class=\"selector-list\">\n <h2 id=\"selectors\">Selectors<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/NgTemplateOutlet#selectors\"><i class=\"material-icons\">link</i></a></h2>\n \n <ul>\n <li><code>[<a href=\"api/common/NgTemplateOutlet\" class=\"code-anchor\">ngTemplateOutlet</a>]</code></li>\n \n </ul>\n \n</section>\n\n\n\n \n\n<section class=\"instance-properties\">\n <h2 id=\"properties\">Properties<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/NgTemplateOutlet#properties\"><i class=\"material-icons\">link</i></a></h2>\n <table class=\"is-full-width list-table property-table\">\n <thead>\n <tr>\n <th>Property</th>\n <th>Description</th>\n </tr>\n </thead>\n <tbody>\n \n <tr class=\"instance-property\">\n <td>\n <a id=\"ngTemplateOutletContext\"></a>\n <code class=\"\"><span class=\"property-binding\">@<a href=\"api/core/Input\" class=\"code-anchor\">Input</a>()</span><br><span class=\"member-name\">ngTemplateOutletContext</span>: Object | null</code>\n </td>\n <td>\n \n <p>A context object to attach to the <a href=\"api/core/EmbeddedViewRef\"><code>EmbeddedViewRef</code></a>. This should be an\nobject, the object's keys will be available for binding by the local template <code>let</code>\ndeclarations.\nUsing the key <code>$implicit</code> in the context object will set its value as default.</p>\n\n \n </td>\n </tr>\n \n <tr class=\"instance-property\">\n <td>\n <a id=\"ngTemplateOutlet\"></a>\n <code class=\"\"><span class=\"property-binding\">@<a href=\"api/core/Input\" class=\"code-anchor\">Input</a>()</span><br><span class=\"member-name\"><a href=\"api/common/NgTemplateOutlet\" class=\"code-anchor\">ngTemplateOutlet</a></span>: <a href=\"api/core/TemplateRef\" class=\"code-anchor\">TemplateRef</a><any> | null</code>\n </td>\n <td>\n \n <p>A string defining the template reference and optionally the context object for the template.</p>\n\n \n </td>\n </tr>\n \n </tbody>\n </table>\n</section>\n\n\n\n \n\n\n \n <section class=\"description\">\n <h2 id=\"description\">Description<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/NgTemplateOutlet#description\"><i class=\"material-icons\">link</i></a></h2>\n <p>You can attach a context object to the <code><a href=\"api/core/EmbeddedViewRef\" class=\"code-anchor\">EmbeddedViewRef</a></code> by setting <code>[ngTemplateOutletContext]</code>.\n<code>[ngTemplateOutletContext]</code> should be an object, the object's keys will be available for binding\nby the local template <code>let</code> declarations.</p>\n\n <code-example>\n<ng-container *<a href=\"api/common/NgTemplateOutlet\" class=\"code-anchor\">ngTemplateOutlet</a>=\"templateRefExp; context: contextExp\"></ng-container>\n</code-example>\n<p>Using the key <code>$implicit</code> in the context object will set its value as default.</p>\n<h3 id=\"example\">Example<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/NgTemplateOutlet#example\"><i class=\"material-icons\">link</i></a></h3>\n<code-example path=\"common/ngTemplateOutlet/ts/module.ts\" region=\"NgTemplateOutlet\">\n@<a href=\"api/core/Component\" class=\"code-anchor\">Component</a>({\n selector: 'ng-template-outlet-example',\n template: `\n <ng-container *<a href=\"api/common/NgTemplateOutlet\" class=\"code-anchor\">ngTemplateOutlet</a>=\"greet\"></ng-container>\n <hr>\n <ng-container *<a href=\"api/common/NgTemplateOutlet\" class=\"code-anchor\">ngTemplateOutlet</a>=\"eng; context: myContext\"></ng-container>\n <hr>\n <ng-container *<a href=\"api/common/NgTemplateOutlet\" class=\"code-anchor\">ngTemplateOutlet</a>=\"svk; context: myContext\"></ng-container>\n <hr>\n\n <ng-template #greet><span>Hello</span></ng-template>\n <ng-template #eng let-name><span>Hello {{name}}!</span></ng-template>\n <ng-template #svk let-person=\"localSk\"><span>Ahoj {{person}}!</span></ng-template>\n`\n})\nexport class NgTemplateOutletExample {\n myContext = {$implicit: 'World', localSk: 'Svet'};\n}\n\n</code-example>\n\n </section>\n \n\n \n\n \n\n \n\n<section class=\"instance-methods\">\n <h2 id=\"methods\">Methods<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/NgTemplateOutlet#methods\"><i class=\"material-icons\">link</i></a></h2>\n \n <a id=\"ngOnChanges\"></a>\n<table class=\"is-full-width method-table instance-method\">\n <thead><tr><th>\n <div class=\"with-github-links\">\n <h3 id=\"ngonchanges\">\n ngOnChanges()\n \n <a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/NgTemplateOutlet#ngonchanges\"><i class=\"material-icons\">link</i></a></h3>\n <div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/packages/common/src/directives/ng_template_outlet.ts?message=docs(common)%3A%20describe%20your%20change...#L53-L69\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n <a href=\"https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/directives/ng_template_outlet.ts#L53-L69\" aria-label=\"View Source\" title=\"View Source\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">code</i></a>\n</div>\n </div>\n </th></tr></thead>\n <tbody>\n \n \n <tr>\n <td>\n <div class=\"overload-info\">\n \n\n <code-example language=\"ts\" hidecopy=\"true\" class=\"no-box api-heading\"><span class=\"member-name\">ngOnChanges</span>(changes: <a href=\"api/core/SimpleChanges\" class=\"code-anchor\">SimpleChanges</a>)</code-example>\n\n \n\n <h6 class=\"no-anchor\" id=\"parameters\">Parameters</h6>\n <table class=\"is-full-width list-table parameters-table instance-method-overload-parameters\">\n <tbody>\n \n <tr class=\"instance-method-overload-parameter\">\n <td class=\"param-name\">\n <a id=\"\"></a>\n <code>changes</code>\n </td>\n <td class=\"param-type\"><code><a href=\"api/core/SimpleChanges\" class=\"code-anchor\">SimpleChanges</a></code></td>\n <td class=\"param-description\">\n \n \n </td>\n </tr>\n </tbody>\n</table>\n\n \n\n\n \n\n \n</div>\n </td>\n </tr>\n \n\n \n\n \n </tbody>\n</table>\n\n \n</section>\n\n \n \n \n\n </div>\n</article>\n\n<!-- links to this doc:\n - api/common\n - api/common/CommonModule\n - api/core/OnChanges\n-->\n<!-- links from this doc:\n - /api\n - api/common\n - api/common/CommonModule\n - api/common/NgTemplateOutlet#description\n - api/common/NgTemplateOutlet#example\n - api/common/NgTemplateOutlet#methods\n - api/common/NgTemplateOutlet#ngmodule\n - api/common/NgTemplateOutlet#ngonchanges\n - api/common/NgTemplateOutlet#ngtemplateoutlet\n - api/common/NgTemplateOutlet#properties\n - api/common/NgTemplateOutlet#selectors\n - api/core/Component\n - api/core/EmbeddedViewRef\n - api/core/Input\n - api/core/SimpleChanges\n - api/core/TemplateRef\n - https://github.com/angular/angular/edit/master/packages/common/src/directives/ng_template_outlet.ts?message=docs(common)%3A%20describe%20your%20change...#L10-L70\n - https://github.com/angular/angular/edit/master/packages/common/src/directives/ng_template_outlet.ts?message=docs(common)%3A%20describe%20your%20change...#L53-L69\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/directives/ng_template_outlet.ts#L10-L70\n - https://github.com/angular/angular/tree/12.0.0-next.7/packages/common/src/directives/ng_template_outlet.ts#L53-L69\n-->"
|
|
} |