0
나는 classA.moduleClassB
처럼 사용하는 모듈 내 제공을 확장 싶지만 그럴 수 없어 나는 (내가 원하는) 공급자Ionic2 제공자에서 모듈 클래스를 만들고 사용할 수 있습니까?
예로 내 컨트롤러 페이지에 모듈 클래스 객체를 가져올 방법을 모른다 :
제공/내-제공/내 - provider.ts
export class MyParentClass {
//...
}
export module a {
class MyChildClass {
//...
}
}
페이지/홈/home.ts
import { Component } from '@angular/core';
import { MyParentClass, MyChildClass } from '../../providers/my-provider'
@Component({
selector: 'page-home',
templateUrl: 'home.html',
providers: [
MyParentClass,
MyChildClass
]
});
export class homePage {
constructor(public parentClass: MyParentClass, public childClass: MyChildClass) {
}
}
답장을 편집하고 간단한 예를 쓸 수 있습니까? 감사! –
예를 들어 내 게시물을 편집했습니다. –
너무 많이 감사드립니다! 투표하기! –