mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
test(img): img/basic test export MyImg component from NgModule
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
|
||||
import { IonicPageModule } from '../../../../../..';
|
||||
|
||||
import { MyImg } from './my-img';
|
||||
@ -7,6 +8,9 @@ import { MyImg } from './my-img';
|
||||
declarations: [
|
||||
MyImg,
|
||||
],
|
||||
exports: [
|
||||
MyImg
|
||||
],
|
||||
imports: [
|
||||
IonicPageModule.forChild(MyImg)
|
||||
]
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { Component, Input } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: '<my-img>',
|
||||
template: '<ion-img [width]="width" [height]="height" [src]="src"></ion-img>'
|
||||
selector: 'my-img',
|
||||
template: `<ion-img [width]="width" [height]="height" [src]="src"></ion-img>`
|
||||
})
|
||||
export class MyImg {
|
||||
@Input() width: any;
|
||||
@Input() height: any;
|
||||
@Input() src: any;
|
||||
@Input() public width: number;
|
||||
@Input() public height: number;
|
||||
@Input() public src: string;
|
||||
}
|
||||
|
Reference in New Issue
Block a user