angular ivy

This commit is contained in:
병준 박 2019-10-25 09:46:05 +09:00
parent 549e915485
commit bf2e4e3c86
7 changed files with 69 additions and 61 deletions

View File

@ -74,25 +74,31 @@ function createWindow() {
const window = new AppWindow(); const window = new AppWindow();
if (__DEV__) { if (__DEV__) {
const { // const {
default: installExtension, // default: installExtension,
REDUX_DEVTOOLS // REDUX_DEVTOOLS
} = require('electron-devtools-installer'); // } = require('electron-devtools-installer');
require('electron-debug')({ showDevTools: true }); import('electron-debug').then(ed => {
ed.default({ showDevTools: true });
});
const ChromeLens = { import('electron-devtools-installer').then(edi => {
id: 'idikgljglpfilbhaboonnpnnincjhjkd', const ChromeLens = {
electron: '>=1.2.1' id: 'idikgljglpfilbhaboonnpnnincjhjkd',
}; electron: '>=1.2.1'
};
const extensions = [REDUX_DEVTOOLS, ChromeLens]; const extensions = [edi.REDUX_DEVTOOLS, ChromeLens];
for (const extension of extensions) { for (const extension of extensions) {
try { try {
installExtension(extension); edi.default(extension);
} catch (e) {} } catch (e) {
} console.log(e);
}
}
});
} }
window.onClose(() => { window.onClose(() => {

View File

@ -6,17 +6,25 @@ const routes: Routes = [
{ path: '', redirectTo: '/messenger', pathMatch: 'full' }, { path: '', redirectTo: '/messenger', pathMatch: 'full' },
{ {
path: 'messenger', path: 'messenger',
loadChildren: loadChildren: () =>
'./pages/messenger/messenger.page.module#AppMessengerPageModule', import('./pages/messenger/messenger.page.module').then(
m => m.AppMessengerPageModule
),
canActivate: [AppAuthGuard] canActivate: [AppAuthGuard]
}, },
{ {
path: 'account', path: 'account',
loadChildren: './pages/account/account.page.module#AppAccountPageModule' loadChildren: () =>
import('./pages/account/account.page.module').then(
m => m.AppAccountPageModule
)
}, },
{ {
path: 'template', path: 'template',
loadChildren: './pages/template/template.page.module#AppTemplatePageModule' loadChildren: () =>
import('./pages/template/template.page.module').then(
m => m.AppTemplatePageModule
)
} }
]; ];

View File

@ -14,6 +14,7 @@ import { UCapPiModule } from '@ucap-webmessenger/pi';
import { UCapProtocolModule } from '@ucap-webmessenger/protocol'; import { UCapProtocolModule } from '@ucap-webmessenger/protocol';
import { UCapAuthenticationProtocolModule } from '@ucap-webmessenger/protocol-authentication'; import { UCapAuthenticationProtocolModule } from '@ucap-webmessenger/protocol-authentication';
import { UCapEventProtocolModule } from '@ucap-webmessenger/protocol-event'; import { UCapEventProtocolModule } from '@ucap-webmessenger/protocol-event';
import { UCapGroupProtocolModule } from '@ucap-webmessenger/protocol-group';
import { UCapInfoProtocolModule } from '@ucap-webmessenger/protocol-info'; import { UCapInfoProtocolModule } from '@ucap-webmessenger/protocol-info';
import { UCapInnerProtocolModule } from '@ucap-webmessenger/protocol-inner'; import { UCapInnerProtocolModule } from '@ucap-webmessenger/protocol-inner';
import { UCapOptionProtocolModule } from '@ucap-webmessenger/protocol-option'; import { UCapOptionProtocolModule } from '@ucap-webmessenger/protocol-option';
@ -73,6 +74,7 @@ import { AppNativeLayoutModule } from './layouts/native/native.layout.module';
}), }),
UCapAuthenticationProtocolModule.forRoot(), UCapAuthenticationProtocolModule.forRoot(),
UCapEventProtocolModule.forRoot(), UCapEventProtocolModule.forRoot(),
UCapGroupProtocolModule.forRoot(),
UCapInfoProtocolModule.forRoot(), UCapInfoProtocolModule.forRoot(),
UCapInnerProtocolModule.forRoot(), UCapInnerProtocolModule.forRoot(),
UCapOptionProtocolModule.forRoot(), UCapOptionProtocolModule.forRoot(),

View File

@ -1,5 +1,3 @@
import * as url from 'url';
export abstract class UrlConfig { export abstract class UrlConfig {
constructor( constructor(
protected useSsl: boolean, protected useSsl: boolean,
@ -18,13 +16,20 @@ export abstract class UrlConfig {
: 'http:'; : 'http:';
} }
protected getUrl(extra: url.UrlObject): string { protected getUrl(extra: Partial<URL>): string {
return url.format({ const url = new URL(
...extra, `${this.getProtocol()}//${this.domain}:${String(this.port)}`
protocol: this.getProtocol(), );
hostname: this.domain,
port: this.port for (const key in extra) {
}); if (extra.hasOwnProperty(key)) {
url[key] = extra[key];
}
}
console.log('url.href', url.href);
return url.href;
} }
} }

View File

@ -1,5 +1,9 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"angularCompilerOptions": {
"enableIvy": true,
"allowEmptyCodegenFiles": true
},
"compilerOptions": { "compilerOptions": {
"outDir": "../../out-tsc/app", "outDir": "../../out-tsc/app",
"types": [] "types": []

View File

@ -7,14 +7,8 @@ import { ucapAnimations } from '../animations';
@Component({ @Component({
selector: 'ucap-ui-imaage', selector: 'ucap-ui-imaage',
template: ` template: `
<img <img #imageElement [src]="imageSrc" [style]="baseStyle" [class]="classes" />
#imageElement
[src]="imageSrc"
[style]="baseStyle"
[ngClass]="classList"
/>
`, `,
styles: [],
animations: ucapAnimations animations: ucapAnimations
}) })
export class ImageComponent implements OnInit { export class ImageComponent implements OnInit {
@ -31,41 +25,27 @@ export class ImageComponent implements OnInit {
default: string; default: string;
@Input() @Input()
set style(style: string | object) { set style(style: string) {
let mappedStyles = style as string; this.logger.debug('style', style);
this.baseStyle = style;
if (typeof style === 'object') {
mappedStyles = Object.entries(style).reduce(
(styleString, [propName, propValue]) => {
propName = propName.replace(
/([A-Z])/g,
matches => `-${matches[0].toLowerCase()}`
);
return `${styleString}${propName}:${propValue};`;
},
''
);
this.baseStyle = this.domSanitizer.bypassSecurityTrustStyle(mappedStyles);
} else if (typeof style === 'string') {
this.baseStyle = this.domSanitizer.bypassSecurityTrustStyle(mappedStyles);
}
} }
@Input() @Input()
set imageClass(classes: string) { set imageClass(classes: string) {
if (classes && classes.length) { // if (classes && classes.length) {
classes.split(' ').forEach((className: string) => { // classes.split(' ').forEach((className: string) => {
this.classList[className] = true; // this.classList[className] = true;
}); // });
this.elementRef.nativeElement.className = ''; // this.elementRef.nativeElement.className = '';
} // }
this.classes = classes;
} }
baseStyle: SafeStyle; baseStyle: SafeStyle;
imageSrc: string; imageSrc: string;
classList: { [key: string]: boolean } = {}; // classList: { [key: string]: boolean } = {};
classes: string;
constructor( constructor(
private elementRef: ElementRef<HTMLElement>, private elementRef: ElementRef<HTMLElement>,

View File

@ -4,6 +4,9 @@
export * from './lib/animations'; export * from './lib/animations';
export * from './lib/components/file-upload-queue.component';
export * from './lib/components/image.component';
export * from './lib/dialogs/alert.dialog.component'; export * from './lib/dialogs/alert.dialog.component';
export * from './lib/dialogs/confirm.dialog.component'; export * from './lib/dialogs/confirm.dialog.component';