简体   繁体   English

如何让 mat-toolbar 响应 Angular 的变化?

[英]How to get mat-toolbar to respond to changes in Angular?

I have been trying to make a basic header for the homepage, for my webapp for some time now, I want to use mat-toolbar, but it will not set the way that I want it to.我一直在尝试为主页制作一个基本的标题,一段时间以来我的 web 应用程序,我想使用 mat-toolbar,但它不会设置我想要的方式。 My code is as follows.我的代码如下。

 .maintooly { background-color: rgba(0,0,0,.7) }
 <mat-toolbar color="primary" class="main-tooly"> <span id="product-name"> HOMEPAGE </span> <div class="vertical-line title-line"> | </div> </mat-toolbar>

This is a watered down example but essentially I am trying to add a header to the to top of the page so it would look like this:这是一个淡化的例子,但基本上我试图在页面顶部添加一个标题,所以它看起来像这样:

我想要的是

But instead it is looking like this:但它看起来像这样:

我得到了什么

Summmary: cannot get items in header to display side by side and cannot get the color of header to change or really do anything.总结:不能让标题中的项目并排显示,也不能让标题的颜色改变或真正做任何事情。

What exactly am I doing wrong here and how can I make this work?我到底做错了什么,我怎样才能做到这一点?

解决方案是将导入工具放入 app.module.ts 文件中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM