我正在学习角度,我已经创建了一个注册组件但是我有以下错误:
registration.component.ts(4,19):未终止的正则表达式文字。
/app/registration/registration.component.ts
import { Component } from ‘@angular/core’;
@Component({
selector : ‘app-registration’,
templateUrl : ‘./registration.component.html’,
styleUrls : [‘./registration.component.css’]
})
export class RegistrationComponent{}
/app/app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import { RegistrationComponent } from
'./registration/registration.component';
@NgModule({
declarations: [
AppComponent,
RegistrationComponent
],
imports: [
BrowserModule,
FormsModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
我需要了解我的错误在哪里以及编译失败的原因谢谢
答案 0 :(得分:2)
其‘
运算符错误:
将此‘
替换为'
。
由此:
import { Component } from ‘@angular/core’;
...
selector : ‘app-registration’,
templateUrl : ‘./registration.component.html’,
styleUrls : [‘./registration.component.css’]
到
import { Component } from '@angular/core';
...
selector : 'app-registration',
templateUrl : './registration.component.html',
styleUrls : ['./registration.component.css']