Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. An unhandled exception occurred while processing the request.
  2.  
  3. Exception: Call to Node module failed with error: Prerendering failed because of error: ReferenceError: Event is not defined
  4.  
  5. <button pButton type="button" (click)="onclick()" >Click here</button>
  6. <p-autoComplete [(ngModel)]="text" [suggestions]="results" (completeMethod)="search($event)"></p-autoComplete>
  7.  
  8. import { Component, OnInit } from '@angular/core';
  9. import {ButtonModule, ToggleButtonModule} from 'primeng/primeng';
  10.  
  11. @Component({
  12. selector: 'app',
  13. templateUrl: './app.component.html',
  14. styleUrls: ['./app.component.css'],
  15. })
  16.  
  17. export class AppComponent {
  18. text: string;
  19. results: string[];
  20. search(event){
  21. this.results = ['1','2','3'];
  22. }
  23.  
  24. onclick():void{
  25. alert("This is a test");
  26. }
  27. }
  28.  
  29. import { NgModule } from '@angular/core';
  30. import { RouterModule } from '@angular/router';
  31. import { UniversalModule } from 'angular2-universal';
  32. import { HttpModule } from '@angular/http';
  33. import { FormsModule } from '@angular/forms';
  34.  
  35. import { AppComponent } from './components/app/app.component'
  36. import {ButtonModule, AutoCompleteModule} from 'primeng/primeng';
  37.  
  38. @NgModule({
  39. bootstrap: [AppComponent],
  40. declarations: [
  41. AppComponent
  42. ],
  43. imports: [
  44. HttpModule,
  45. FormsModule,
  46. RouterModule.forRoot([
  47. { path: '', redirectTo: 'home', pathMatch: 'full' },
  48. { path: 'home', component: HomeComponent },
  49. { path: 'api-list', component: ApiListComponent },
  50. { path: 'api-add', component: ApiAddComponent },
  51. { path: '**', redirectTo: 'home', pathMatch: 'full' }
  52. ]),
  53. AutoCompleteModule,
  54. UniversalModule
  55. ]
  56. })
  57. export class AppModule {
  58. }
  59.  
  60. <app>Loading...</app>
  61.  
  62. <app asp-prerender-module="ClientApp/dist/main-server">Loading...</app>
  63.  
  64. <app asp-ng2-prerender-module="ClientApp/dist/main-server">Loading...</app>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement