Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Component, OnInit } from '@angular/core';
- import { Router, ActivatedRoute, Params } from '@angular/router';
- import { User } from '../../models/user';
- @Component({
- selector: 'register',
- templateUrl: './register.component.html'
- })
- export class RegisterComponent implements OnInit {
- public title: string;
- public user: User;
- constructor(
- private _route: ActivatedRoute,
- private _router: Router
- ) {
- this.title = 'Registrate';
- this.user = new User('', '', '', '', '', '', 'ROLE_USER', '');
- }
- ngOnInit() {
- console.log('Componente de register cargado...');
- }
- }
- **ERROR in src/app/components/register/register.component.ts(18,17):
- error TS2554: Expected 0 arguments, but got 8.**
- export class User {
- contructor(
- public _id: string,
- public name: string,
- public surname: string,
- public nick: string,
- public email: string,
- public password: string,
- public role: string,
- public image: string
- ){}
- }
- ERROR in src/app/components/register/register.component.ts(18,17): error TS2554: Expected 0 arguments, but got 8.
- src/app/models/user.ts(3,5): error TS2369: A parameter property is only allowed in a constructor implementation.
- src/app/models/user.ts(4,5): error TS2369: A parameter property is only allowed in a constructor implementation.
- src/app/models/user.ts(5,5): error TS2369: A parameter property is only allowed in a constructor implementation.
- src/app/models/user.ts(6,5): error TS2369: A parameter property is only allowed in a constructor implementation.
- src/app/models/user.ts(7,5): error TS2369: A parameter property is only allowed in a constructor implementation.
- src/app/models/user.ts(8,5): error TS2369: A parameter property is only allowed in a constructor implementation.
- src/app/models/user.ts(9,5): error TS2369: A parameter property is only allowed in a constructor implementation.
- src/app/models/user.ts(10,5): error TS2369: A parameter property is only allowed in a constructor implementation.
Add Comment
Please, Sign In to add comment