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