我有一個簡單的應用程序,我得到這個錯誤。不能獲取 /。並在控制檯中。 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