5 lines
9.8 KiB
JSON
Raw Normal View History

{
"id": "api/common/NgSwitch",
"title": "NgSwitch",
"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/NgSwitch\", \"name\": \"NgSwitch\" } }\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_switch.ts?message=docs(common)%3A%20describe%20your%20change...#L35-L155\" 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_switch.ts#L35-L155\" 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=\"ngswitch\">NgSwitch<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/NgSwitch#ngswitch\"><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>The <code>[<a href=\"api/common/NgSwitch\" class=\"code-anchor\">ngSwitch</a>]</code> directive on a container specifies an expression to match against.\nThe expressions to match are provided by <code><a href=\"api/common/NgSwitchCase\" class=\"code-anchor\">ngSwitchCase</a></code> directives on views within the container.</p>\n<ul>\n<li>Every view that matches is rendered.</li>\n<li>If there are no matches, a view with the <code><a href=\"api/common/NgSwitchDefault\" class=\"code-anchor\">ngSwitchDefault</a></code> directive is rendered.</li>\n<li>Elements within the <code>[<a href=\"api/common/NgSwitch\" class=\"code-anchor\">NgSwitch</a>]</code> statement but outside of any <code><a href=\"api/common/NgSwitchCase\" class=\"code-anchor\">NgSwitchCase</a></code>\nor <code><a href=\"api/common/NgSwitchDefault\" class=\"code-anchor\">ngSwitchDefault</a></code> directive are preserved at the location.</li>\n</ul>\n\n \n </section>\n \n \n \n \n<section class=\"see-also\">\n <h2 id=\"see-also\">See also<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/NgSwitch#see-also\"><i class=\"material-icons\">link</i></a></h2>\n <ul>\n \n <li><p><code><a href=\"api/common/NgSwitchCase\" class=\"code-anchor\">NgSwitchCase</a></code></p>\n</li>\n <li><p><code><a href=\"api/common/NgSwitchDefault\" class=\"code-anchor\">NgSwitchDefault</a></code></p>\n</li>\n <li><p><a href=\"guide/structural-directives\">Structural Directives</a></p>\n</li>\n </ul>\n</section>\n\n\n <h2 id=\"ngmodule\">NgModule<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"api/common/NgSwitch#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/NgSwitch#selectors\"><i class=\"material-icons\">link</i></a></h2>\n \n <ul
}