ipsos-components
Version:
Material Design components for Angular
44 lines (34 loc) • 1 kB
text/typescript
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {ComponentPortal, Portal, CdkPortal} from '@angular/cdk/portal';
import {Component, QueryList, ViewChildren} from '@angular/core';
({
moduleId: module.id,
selector: 'portal-demo',
templateUrl: 'portal-demo.html',
styleUrls: ['portal-demo.css'],
})
export class PortalDemo {
(CdkPortal) templatePortals: QueryList<Portal<any>>;
selectedPortal: Portal<any>;
get programmingJoke() {
return this.templatePortals.first;
}
get mathJoke() {
return this.templatePortals.last;
}
get scienceJoke() {
return new ComponentPortal(ScienceJoke);
}
}
({
moduleId: module.id,
selector: 'science-joke',
template: `<p> 100 kilopascals go into a bar. </p>`
})
export class ScienceJoke { }