Angular 5 Material Spinner 不工作 [英] Angular 5 Material Spinner is not working

查看:28
本文介绍了Angular 5 Material Spinner 不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Angular 5 Material Spinner 不工作

Angular 5 Material Spinner is not working

app.module.ts

app.module.ts

import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
@NgModule({
  imports: [
    MatProgressSpinnerModule
  ]})

component.ts

component.ts

import { MatSpinner } from '@angular/material';

component.html

component.html

<mat-spinner></mat-spinner>

我是否缺少任何配置.?

am I missing any configuration.?

参考 中,它正在为 Spinner 生成一个 SVG 文件,但我没有看不到 mat-spinner 标签内的任何内容.

In Reference, it's generating an SVG file for Spinner but I don't see anything inside mat-spinner tag.

推荐答案

我尝试分叉给定的 mat-spinner 示例,并且效果很好.我能看到的唯一区别是您导入进度微调器模块的方式,而不是从特定路径导入它:

I tried to fork the mat-spinner example given and that works perfectly. The only difference that I could see is the way you import the progress spinner module instead of importing it from a specific path do this:

  import { MatProgressSpinnerModule } from '@angular/material';

你不需要在你的组件中导入任何东西,因为 mat-spinner 扩展了 matprogressSpinner.

You don`t need to import anything inside your component as mat-spinner extends matprogressSpinner.

在相关的 html 里面做你正在做的事情,即

Inside the relevant html just do what you were doing i.e.

<mat-spinner></mat-spinner>

你可以看看这个:https://stackblitz.com/angular/eymjpelkpro可能会为您提供更多背景信息.

You can have a look at this: https://stackblitz.com/angular/eymjpelkpro which might give you some more context.

这篇关于Angular 5 Material Spinner 不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆