I'm learning angular and i've created a registration component but I have the following error :
registration.component.ts (4,19): Unterminated regular expression literal.
/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 { }
I need to understand where is my error and why the compile failed thank you
Its ‘ operator error :
replace this ‘ with '.
From this :
import { Component } from ‘@angular/core’;
...
selector : ‘app-registration’,
templateUrl : ‘./registration.component.html’,
styleUrls : [‘./registration.component.css’]
To
import { Component } from '@angular/core';
...
selector : 'app-registration',
templateUrl : './registration.component.html',
styleUrls : ['./registration.component.css']
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With