2016-08-03 48 views
0

我正在使用TypeScript在Ionic 2中查找Angular的$rootScope$scope$watch的等效项。

+0

@GergelyPolonkai $ rootScope,$范围和$手表是变量。在以前版本的IONIC中,我使用[link](http://stackoverflow.com/questions/22738482/angularjs-watch-root-scope-variable-for-changes)。但在打字稿中可能会有所不同。所以想知道相同。谢谢... –

+0

所以你正在从Angular迁移? – GergelyPolonkai

+0

@GergelyPolonkai:是的,有些问题在IONIC 2中被克服,因为这个原因想要使用Ionic 2. –

回答

0

我不知道确切的等价的,但我已经用下面的替代它:

$ rootScope:提供商处理存储

export class AppGames { 
    get GAME_NAMES(): any { 
     return 'pizza/hut'; 
    } 

$范围:this

export class BuyTopUpModalPage { 
    dataList: any = []; 
    constructor() { 
     this.dataList = ['we', 'won'] 
    } 

$观察:可观察

相关问题