角度(4):角度材料2的ng-href?(Angular (4): ng-href for angular material 2?)

有没有像ng-href的角度4和角度材料2,所以我可以使用md-button导航到另一个站点?

谢谢!

Is there something like ng-href but for angular 4 and angular material 2, so that I can navigate to another site by using md-button?

Thanks!

最满意答案

根据Angular Material 2文档 ,您可以将mat-button指令添加到链接。

例:

<a href="https://google.com" target="_blank" mat-button color="primary">Google</a>

You can add mat-button directive to a link, according to Angular Material 2 documentation.

Example:

<a href="https://google.com" target="_blank" mat-button color="primary">Google</a>角度(4):角度材料2的ng-href?(Angular (4): ng-href for angular material 2?)

有没有像ng-href的角度4和角度材料2,所以我可以使用md-button导航到另一个站点?

谢谢!

Is there something like ng-href but for angular 4 and angular material 2, so that I can navigate to another site by using md-button?

Thanks!

最满意答案

根据Angular Material 2文档 ,您可以将mat-button指令添加到链接。

例:

<a href="https://google.com" target="_blank" mat-button color="primary">Google</a>

You can add mat-button directive to a link, according to Angular Material 2 documentation.

Example:

<a href="https://google.com" target="_blank" mat-button color="primary">Google</a>