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

View File

@ -6,17 +6,25 @@ const routes: Routes = [
{ path: '', redirectTo: '/messenger', pathMatch: 'full' },
{
path: 'messenger',
loadChildren:
'./pages/messenger/messenger.page.module#AppMessengerPageModule',
loadChildren: () =>
import('./pages/messenger/messenger.page.module').then(
m => m.AppMessengerPageModule
),
canActivate: [AppAuthGuard]
},
{
path: 'account',
loadChildren: './pages/account/account.page.module#AppAccountPageModule'
loadChildren: () =>
import('./pages/account/account.page.module').then(
m => m.AppAccountPageModule
)
},
{
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 { UCapAuthenticationProtocolModule } from '@ucap-webmessenger/protocol-authentication';
import { UCapEventProtocolModule } from '@ucap-webmessenger/protocol-event';
import { UCapGroupProtocolModule } from '@ucap-webmessenger/protocol-group';
import { UCapInfoProtocolModule } from '@ucap-webmessenger/protocol-info';
import { UCapInnerProtocolModule } from '@ucap-webmessenger/protocol-inner';
import { UCapOptionProtocolModule } from '@ucap-webmessenger/protocol-option';
@ -73,6 +74,7 @@ import { AppNativeLayoutModule } from './layouts/native/native.layout.module';
}),
UCapAuthenticationProtocolModule.forRoot(),
UCapEventProtocolModule.forRoot(),
UCapGroupProtocolModule.forRoot(),
UCapInfoProtocolModule.forRoot(),
UCapInnerProtocolModule.forRoot(),
UCapOptionProtocolModule.forRoot(),

View File

@ -1,5 +1,3 @@
import * as url from 'url';
export abstract class UrlConfig {
constructor(
protected useSsl: boolean,
@ -18,13 +16,20 @@ export abstract class UrlConfig {
: 'http:';
}
protected getUrl(extra: url.UrlObject): string {
return url.format({
...extra,
protocol: this.getProtocol(),
hostname: this.domain,
port: this.port
});
protected getUrl(extra: Partial<URL>): string {
const url = new URL(
`${this.getProtocol()}//${this.domain}:${String(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",
"angularCompilerOptions": {
"enableIvy": true,
"allowEmptyCodegenFiles": true
},
"compilerOptions": {
"outDir": "../../out-tsc/app",
"types": []

View File

@ -7,14 +7,8 @@ import { ucapAnimations } from '../animations';
@Component({
selector: 'ucap-ui-imaage',
template: `
<img
#imageElement
[src]="imageSrc"
[style]="baseStyle"
[ngClass]="classList"
/>
<img #imageElement [src]="imageSrc" [style]="baseStyle" [class]="classes" />
`,
styles: [],
animations: ucapAnimations
})
export class ImageComponent implements OnInit {
@ -31,41 +25,27 @@ export class ImageComponent implements OnInit {
default: string;
@Input()
set style(style: string | object) {
let mappedStyles = style as string;
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);
}
set style(style: string) {
this.logger.debug('style', style);
this.baseStyle = style;
}
@Input()
set imageClass(classes: string) {
if (classes && classes.length) {
classes.split(' ').forEach((className: string) => {
this.classList[className] = true;
});
// if (classes && classes.length) {
// classes.split(' ').forEach((className: string) => {
// this.classList[className] = true;
// });
this.elementRef.nativeElement.className = '';
}
// this.elementRef.nativeElement.className = '';
// }
this.classes = classes;
}
baseStyle: SafeStyle;
imageSrc: string;
classList: { [key: string]: boolean } = {};
// classList: { [key: string]: boolean } = {};
classes: string;
constructor(
private elementRef: ElementRef<HTMLElement>,

View File

@ -4,6 +4,9 @@
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/confirm.dialog.component';