Dr.*_*. X 3 typescript ionic-framework ionic3 angular
我想app.component.ts从其他页面(otherpage.ts)或其他组件访问和更改变量或访问方法,如;
app.component.ts
@Component({
templateUrl: 'app.html'
})
export class MyApp {
accessedVariable: any;
constructor(){ }
accessedMethod() {
..something
}
}
Run Code Online (Sandbox Code Playgroud)
otherpage.ts
@Component({
selector: 'page-other',
templateUrl: './otherpage.html',
})
export class OtherPage {
constructor() { }
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
12254 次 |
| 最近记录: |