2

I'm new in Angular2, I try create new Component but have error

Argument of type '{ selecor: string; templateUrl: string; }' is not assignable 
to parametof type 'Component'.
Object literal may only specify known properties, and 'selecor' does not  
exist in type 'Component'.enter code here.

This is code for component.

Import { Component } from '@angular/core';
@Component({
   selecor: 'app-server',
   templateUrl: './server.component.html'
})
export class ServerComponent {}

And this is snippet code in app.module.ts

import { ServerComponent } from './server/server.component';
@NgModule({
declarations: [
  AppComponent,
  ServerComponent
],
3
  • @Sajeetharan I will do it, per 5 minutes. Now I have blocked this option. Commented Jun 27, 2017 at 16:52
  • 1
    I would suggest using ng cli to make your life easier Commented Jun 27, 2017 at 18:42
  • If you use Angular Cli (cli.angular.io) you can get rid of this kind of typos Commented Jun 28, 2017 at 7:49

1 Answer 1

2

It should be selector instead of selecor,

@Component({
   selector : 'app-server',
   templateUrl: './server.component.html'
})
Sign up to request clarification or add additional context in comments.

1 Comment

You were faster :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.