File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,12 +6,16 @@ import { Component } from '@angular/core';
66 <window title="Angular app in window!">
77 <text [style.font-size.px]="45">Hello, {{ name }}</text>
88
9- <button [style.background-color]="'green'">
9+ <button [style.background-color]="'green'" (clicked)="setName()" >
1010 Green button
1111 </button>
1212 </window>
1313 `
1414} )
1515export class AppComponent {
1616 public name = 'World!' ;
17+
18+ setName ( ) {
19+ this . name = 'irustm' ;
20+ }
1721}
Original file line number Diff line number Diff line change @@ -5,13 +5,7 @@ import {
55 RendererStyleFlags2 ,
66 RendererType2
77} from '@angular/core' ;
8- import {
9- QWidget ,
10- QPushButton ,
11- QLabel ,
12- FlexLayout ,
13- QMainWindow
14- } from '@nodegui/nodegui' ;
8+ import { QMainWindow , NativeEvent } from '@nodegui/nodegui' ;
159import { QWindowService } from './window' ;
1610import { NgWindow } from './components/window' ;
1711import { NgComponent } from './components/component' ;
@@ -96,7 +90,11 @@ export class NodeguiRenderer implements Renderer2 {
9690 eventName : string ,
9791 callback : ( event : any ) => boolean | void
9892 ) : ( ) => void {
99- return ( ) => { } ;
93+ const callbackFunc = ( e : NativeEvent ) => callback . call ( target , e ) ;
94+
95+ target . addEventListener ( eventName , callbackFunc ) ;
96+
97+ return ( ) => target . removeEventListener ( eventName , callbackFunc ) ;
10098 }
10199
102100 nextSibling ( node : any ) : any {
You can’t perform that action at this time.
0 commit comments