File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11< window title ="Angular app in window! ">
2- < view >
2+ < view id =" app " >
33 < image
4+ id ="image "
45 [src] ="'C:/temp/angular.png' "
56 [aspectRatioMode] ="aspectRatioMode "
67 > </ image >
Original file line number Diff line number Diff line change 1- import { Component } from '@angular/core' ;
1+ import { Component , ViewEncapsulation } from '@angular/core' ;
22import { AspectRatioMode } from '@nodegui/nodegui' ;
33
44@Component ( {
55 selector : 'app-root' ,
6- templateUrl : './app.component.html'
6+ templateUrl : './app.component.html' ,
7+ styles : [
8+ `
9+ #app {
10+ background-color: gray;
11+ }
12+ #image {
13+ }
14+ `
15+ ] ,
16+ encapsulation : ViewEncapsulation . None
717} )
818export class AppComponent {
919 public name = 'World!' ;
Original file line number Diff line number Diff line change @@ -32,7 +32,16 @@ export class NgView extends QWidget implements NgComponent {
3232 name : string ,
3333 value : string ,
3434 namespace ?: string | null
35- ) : void { }
35+ ) : void {
36+ switch ( name ) {
37+ case 'id' :
38+ this . setObjectName ( value ) ;
39+ break ;
40+
41+ default :
42+ break ;
43+ }
44+ }
3645
3746 public setProperty ( name : string , value : any ) : void {
3847 throw new Error ( 'Method not implemented.' ) ;
Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ export class NodeguiRendererFactory implements RendererFactory2 {
2828 }
2929
3030 createRenderer ( hostElement : any , type : RendererType2 | null ) : Renderer2 {
31+ if ( type ) {
32+ hostElement . setStyleSheet ( type . styles ) ;
33+ }
3134 return this . renderer ;
3235 }
3336}
@@ -49,6 +52,7 @@ export class NodeguiRenderer implements Renderer2 {
4952 if ( Component ) {
5053 return new Component ( ) ;
5154 } else {
55+ // TODO create widget with name, may be customm component
5256 console . warn ( `${ name } component is not find in components map` ) ;
5357 }
5458 }
@@ -150,6 +154,8 @@ export class NodeguiRenderer implements Renderer2 {
150154 value : any ,
151155 flags ?: RendererStyleFlags2
152156 ) : void {
157+ console . log ( 'setStyle' , style ) ;
158+
153159 el . setStyle ( style , value , flags ) ;
154160 }
155161
You can’t perform that action at this time.
0 commit comments