mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-17 02:31:34 +08:00
fix(angular): icon proxy
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { Directive, ElementRef, Input } from '@angular/core';
|
||||
import { inputs } from './proxies';
|
||||
import { inputs } from '../util/util';
|
||||
|
||||
|
||||
@Directive({ selector: 'ion-icon' })
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,3 +1,14 @@
|
||||
import { ElementRef } from '@angular/core';
|
||||
|
||||
export function inputs(instance: any, el: ElementRef, props: string[]) {
|
||||
props.forEach(propName => {
|
||||
Object.defineProperty(instance, propName, {
|
||||
get: () => el.nativeElement[propName], set: (val: any) => el.nativeElement[propName] = val
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
export function proxyMethod(ctrlName: string, methodName: string, ...args: any[]) {
|
||||
const controller = ensureElementInBody(ctrlName);
|
||||
return controller.componentOnReady()
|
||||
|
Reference in New Issue
Block a user