robwormald / ng-universal-demo

256 stars 126 forks source link

how to use dom event? #15

Closed zh99998 closed 7 years ago

zh99998 commented 7 years ago

I see there is totally no js in generated response . How to do something in browser?

for example <button (click)="sayHello()"> {{greetings}}

sayHello() {this.greetings = "hello"}

marvinscharle commented 7 years ago

I think you have to create a separate js bundle for the browser and load it. I've extended this example a little bit to do just that: https://github.com/marvinscharle/angular-server-test