Angular “角度材质”复选框和单选按钮工作不正常
我使用的是来自的角材料 我按照入门中的步骤添加了所有依赖项。除了复选框和按钮外,其他一切都正常 当我对复选框使用这里提到的语法时,我得到两个复选框,如下所示 此外,我没有得到任何涟漪风格。单选按钮也是一样。有人能帮我解决这个问题吗 下面是我的app.module.ts代码Angular “角度材质”复选框和单选按钮工作不正常,angular,checkbox,angular-material,Angular,Checkbox,Angular Material,我使用的是来自的角材料 我按照入门中的步骤添加了所有依赖项。除了复选框和按钮外,其他一切都正常 当我对复选框使用这里提到的语法时,我得到两个复选框,如下所示 此外,我没有得到任何涟漪风格。单选按钮也是一样。有人能帮我解决这个问题吗 下面是我的app.module.ts代码 import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { Fo
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import { AppComponent } from './app.component';
import {MdButtonModule, MdCheckboxModule} from '@angular/material';
import { SampleComponent } from './sample/sample.component';
import 'hammerjs';
@NgModule({
declarations: [
AppComponent,
SampleComponent
],
imports: [
BrowserModule,
FormsModule,
HttpModule,
BrowserAnimationsModule,MdButtonModule, MdCheckboxModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
index.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>AngularMaterialTest</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link href="../node_modules/@angular/material/prebuilt-themes/indigo-pink.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body>
<app-root>Loading...</app-root>
</body>
</html>
角材料试验
加载。。。
app.component.html
<h1>
{{title}}
</h1>
<md-checkbox>Check me!</md-checkbox>
{{title}}
检查我!
可能迟了8个月,但您的进口“hammerjs”;写入错误的文件夹,应将其放置在main.ts文件中。
你可以试试这个指南,还有一个视频可以看
可能晚了8个月,但您的进口“hammerjs”;写入错误的文件夹,应将其放置在main.ts文件中。 你可以试试这个指南,还有一个视频可以看
您的应用程序中是否包含
材料
文件和css?请提供包含在您的应用程序添加代码中的材料的代码片段。此外,我还安装了@angular/material、@angular/animations节点包如果你点击F12,你是否看到任何JavaScript错误或404?我正在获取该GET material。es5.js:148找不到angular material核心主题。大多数材料组件可能无法按预期工作。有关更多信息,请参阅主题化指南:。但是当替换为无控制台错误时。但是问题没有解决。您的应用程序中是否包含材料文件和css?请提供包含在您的应用程序添加代码中的材料的代码片段。此外,我还安装了@angular/material、@angular/animations节点包如果你点击F12,你是否看到任何JavaScript错误或404?我正在获取该GET material。es5.js:148找不到angular material核心主题。大多数材料组件可能无法按预期工作。有关更多信息,请参阅主题化指南:。但是当替换为无控制台错误时。但问题并没有得到解决。