Guest User

Untitled

a guest
Jan 23rd, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. Uncaught Error: Unexpected value 'AppComponent' declared by the module
  2. 'AppModule'.
  3.  
  4. Please add a @Pipe/@Directive/@Component annotation.
  5. at syntaxError (compiler.js:485)
  6. at eval (compiler.js:15282)
  7. at Array.forEach (<anonymous>)
  8. at CompileMetadataResolver.getNgModuleMetadata (compiler.js:15264)
  9. at JitCompiler._loadModules (compiler.js:34398)
  10. at JitCompiler._compileModuleAndComponents (compiler.js:34359)
  11. at JitCompiler.compileModuleAsync (compiler.js:34253)
  12. at CompilerImpl.compileModuleAsync (platform-browser-dynamic.js:239)
  13. at PlatformRef.bootstrapModule (core.js:5561)
  14. at eval (main.ts:11)
  15.  
  16. import { Component, OnInit } from '@angular/core';
  17. import { CanvasSettings } from './canvas-settings';
  18. import { Rate } from './rate';
  19. import { RateService } from './rates.service';
  20.  
  21. @Component({
  22. selector: 'app-root',
  23. templateUrl: './app.component.html',
  24. styleUrls: ['./app.component.css'],
  25. providers: [RateService]
  26. })
  27.  
  28. export class DatePoint() {
  29. X: number;
  30. Y: number;
  31. cost: number;
  32. diff: number;
  33. }
  34.  
  35. export class AppComponent implements OnInit {
  36.  
  37. title = 'Exchange Rate via Canvas';
  38. bgrdCanvas = new CanvasSettings("bgrdCanvas");
  39. interactiveCanvas = new CanvasSettings("iaCanvas");
  40. rates: Rate[];
  41. dateArray: DatePoint[][][];
  42. sampleProperty: number;
  43.  
  44. constructor(private _rateService: RateService){}
  45.  
  46. ngOnInit() {
  47. this.getRates();
  48. this.setDateArray();
  49. console.log(this.dateArray);
  50. console.log(this.rates);
  51. }
  52.  
  53. getRates() {
  54. this._rateService.getRates().then(rates => this.rates = rates);
  55. }
  56.  
  57. setDateArray() {
  58. this.sampleProperty = 8;
  59. }
  60.  
  61. }
Add Comment
Please, Sign In to add comment