Angular Material 團隊在前一陣子推出 Angular CDK 的套件,什麼是 Angular CDK ? 簡單的說就是 Angular material 2 底層在使用的功能而樣式的部分就留給我們自己設計。
The goal of the CDK is to give developers more tools to build awesome components for the web. This will be especially useful for projects that want to take advantage of the features of Angular Material without adopting the Material Design visual language. — Angular Team
<buttontype="button" (click)="selectedPortal = mathJoke"> Math joke </button> <ng-templatecdk-portal> <p> - Why don't jokes work in octal?</p> <p> - Because 7 10 11.</p> </ng-template>
<div *cdk-portal> <p> - Did you hear about this year's Fibonacci Conference? </p> <p> - It's going to be as big as the last two put together. </p> </div>
<buttontype="button" (click)="setDisplayPort(mathJoke)"> Math joke </button> <ng-templatecdk-portal> <p> - Why don't jokes work in octal?</p> <p> - Because 7 10 11.</p> </ng-template>
<div *cdk-portal> <p> - Did you hear about this year's Fibonacci Conference? </p> <p> - It's going to be as big as the last two put together. </p> </div>