当我在主页中调用提供程序方法时,值未返回。
Home.ts
import { MediaProvider } from '../../providers/media/media';
export class HomePage {
private val;
constructor(private media:MediaProvider)
{
this.get()
}
get()
{
this.val = this.media.get();
alert(this.val);
}
}
media.ts
export class MediaProvider {
public val;
constructor()
{}
get()
{
this.val="app";
return this.val;
}
}