Ich suche nach Äquivalenten von Angulars $rootScope
, $scope
und $watch
in Ionic 2 mit TypeScript.
0
A
Antwort
0
ich nicht das genaue Äquivalent wissen, aber ich habe es mit den folgenden ersetzt:
$ rootScope: Anbieter, dass die Speicher
export class AppGames {
get GAME_NAMES(): any {
return 'pizza/hut';
}
$ scope Griff: this
export class BuyTopUpModalPage {
dataList: any = [];
constructor() {
this.dataList = ['we', 'won']
}
$ Uhr: Observable
0
Für äquivalent zu $ rootScope, Sie können Basisklasse für alle Komponenten verwenden und alle freigegebenen Vars und Methoden setzen
Blick auf diese Antwort, um weitere Informationen
Verwandte Themen
- 1. Angular 2 - Was entspricht dem Root Scope?
- 2. Zugriff auf $ rootScope und $ scope in `$ rootScope. $ On`
- 3. angular.js $ scope. $ Broadcast, $ scope. $ Emit, $ rootScope. $ Broadcast was zu verwenden?
- 4. Was ist der Unterschied zwischen $ scope. $ Root und $ rootScope?
- 5. Verschachteltes Callback Scope und rootScope AngularJS
- 6. Typescript lambdas und closure (scope)
- 7. Html zu $ scope oder $ rootScope?
- 8. Mit scope = $ rootScope $ new() oder scope = {} in angluar.js Unit-Tests
- 9. Scope-Variable ist Null in $ rootScope. $ Auf
- 10. Verwenden von Windows.plugins mit Ionic 2 Typescript
- 11. Ionic Update $ scope Variable
- 12. Wie bekomme ich Geräte-ID in Ionic 2 mit TypeScript
- 13. AngularJS ng-src aktualisiert nicht mit $ watch on $ rootScope
- 14. Hinzufügen eines Bildlaufs nach oben (Ionic 2 | Typescript)
- 15. Ionic 2 Uhr Ortsfehler
- 16. $ scope. $ Watch Funktion spiegelt keine Änderungen wider?
- 17. Was ist 'billiger' Leistung $ Broadcast oder $ watch
- 18. $ Scope ist undefined in Ionic Popup
- 19. Wie wird der Wert von $ rootscope in $ scope gespeichert?
- 20. Ionic 2 und ng-Modell
- 21. Was ist in TypeScript geschützt?
- 22. Ionic Framework entspricht für Knockout?
- 23. Ionic 2 Facebook-Login
- 24. Actionscript 2 Scope
- 25. Ist $ rootScope das übergeordnete Element des obersten $ scope?
- 26. Deklaration Methode entspricht Schnittstelle in TypeScript
- 27. Ionic 2 Alert Problem
- 28. Syntax von Elementeigenschaften und Konstruktoren in angular 2 typescript
- 29. Warum Scope. $ Apply() ruft $ rootScope. $ Digest() statt dies. $ Digest()?
- 30. Kann ein einzelnes $ rootScope. $ Broadcast mehrere $ scope. $ On aufrufen?
@GergelyPolonkai $ rootScope, $ Umfang und $ Uhr sind Variablen. In der vorherigen Version von IONIC habe ich [link] (http://stackoverflow.com/questions/22738482/angularjs-watch-root-scope-variable-for-changes) verwendet. Aber es kann sich im Typoskript unterscheiden. Ich möchte Äquivalent wissen. Danke ... –
Sie migrieren also von Angular? – GergelyPolonkai
@GergelyPolonkai: Ja, einige der Probleme werden in IONIC 2 mit diesem Grund überwunden werden wollen, um Ionic 2 zu verwenden. –