Guest User

Untitled

a guest
Jun 29th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. import { Component, OnInit } from '@angular/core';
  2. import { Router, ActivatedRoute, Params } from '@angular/router';
  3. import { User } from '../../models/user';
  4.  
  5. @Component({
  6. selector: 'register',
  7. templateUrl: './register.component.html'
  8. })
  9.  
  10. export class RegisterComponent implements OnInit {
  11. public title: string;
  12. public user: User;
  13. constructor(
  14. private _route: ActivatedRoute,
  15. private _router: Router
  16. ) {
  17. this.title = 'Registrate';
  18. this.user = new User('', '', '', '', '', '', 'ROLE_USER', '');
  19. }
  20.  
  21. ngOnInit() {
  22. console.log('Componente de register cargado...');
  23. }
  24. }
  25.  
  26. **ERROR in src/app/components/register/register.component.ts(18,17):
  27. error TS2554: Expected 0 arguments, but got 8.**
  28.  
  29. export class User {
  30. contructor(
  31. public _id: string,
  32. public name: string,
  33. public surname: string,
  34. public nick: string,
  35. public email: string,
  36. public password: string,
  37. public role: string,
  38. public image: string
  39. ){}
  40. }
  41.  
  42. ERROR in src/app/components/register/register.component.ts(18,17): error TS2554: Expected 0 arguments, but got 8.
  43. src/app/models/user.ts(3,5): error TS2369: A parameter property is only allowed in a constructor implementation.
  44. src/app/models/user.ts(4,5): error TS2369: A parameter property is only allowed in a constructor implementation.
  45. src/app/models/user.ts(5,5): error TS2369: A parameter property is only allowed in a constructor implementation.
  46. src/app/models/user.ts(6,5): error TS2369: A parameter property is only allowed in a constructor implementation.
  47. src/app/models/user.ts(7,5): error TS2369: A parameter property is only allowed in a constructor implementation.
  48. src/app/models/user.ts(8,5): error TS2369: A parameter property is only allowed in a constructor implementation.
  49. src/app/models/user.ts(9,5): error TS2369: A parameter property is only allowed in a constructor implementation.
  50. 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