我有一个简单的应用程序,我得到这个错误。不能获取 /。并在控制台中。 Error in event handler for (unknown): TypeError: Cannot read property 'checked' of null at Object.SL_BBL_locer (chrome-extension://noaijdpnepcgjemiklgfkcfbkokogabh/content/js/inject/translator.js:1174:41) at chrome-extension://noaijdpnepcgjemiklgfkcfbkokogabh/content/js/inject/data.js:100:30
错误我角。不能GET/
我真的不知道,我做错了什么。这是我的代码。
app.module
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { DashboardComponent } from './dashboard/dashboard.component';
import {AppRoutingModule} from './app-routing.module';
@NgModule({
declarations: [
AppComponent,
DashboardComponent
],
imports: [
BrowserModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
app.component
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'app';
}
**app.component.html**
<div>
<app-dashboard></app-dashboard>
</div>
dashboard.component
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-dashboard',
templateUrl: './dashboard.component.html',
styleUrls: ['./dashboard.component.css']
})
export class DashboardComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
dashoboard.component.html
<div> Im here</div>
你的错误信息是说你想读一个变量为空,而不是一个对象“选中”属性。但是你提供的代码似乎与错误有关。 –
这条线是干什么的:'this.workSchedules = WorkSchedules;'?它似乎是将一个类型分配给一个数组? – DeborahK
@CodeSpirit那这个问题我无法找到我的代码的任何地方我有检查 – user3701188