mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
Some typos fixed
This commit is contained in:
@ -68,7 +68,7 @@ class IOSApplication implements definition.iOSApplication {
|
||||
this.addNotificationObserver(UIApplicationDidEnterBackgroundNotification, this.didEnterBackground);
|
||||
this.addNotificationObserver(UIApplicationWillTerminateNotification, this.willTerminate);
|
||||
this.addNotificationObserver(UIApplicationDidReceiveMemoryWarningNotification, this.didReceiveMemoryWarning);
|
||||
this.addNotificationObserver(UIDeviceOrientationDidChangeNotification, this.oreintationDidChange);
|
||||
this.addNotificationObserver(UIDeviceOrientationDidChangeNotification, this.orientationDidChange);
|
||||
}
|
||||
|
||||
get nativeApp(): UIApplication {
|
||||
@ -162,7 +162,7 @@ class IOSApplication implements definition.iOSApplication {
|
||||
exports.notify({ eventName: definition.lowMemoryEvent, object: this, android: undefined, ios: UIApplication.sharedApplication() });
|
||||
}
|
||||
|
||||
private oreintationDidChange(notification: NSNotification) {
|
||||
private orientationDidChange(notification: NSNotification) {
|
||||
var orientation = UIDevice.currentDevice().orientation;
|
||||
|
||||
if (this._currentOrientation !== orientation) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
<Page xmlns="http://www.nativescript.org/tns.xsd" loaded="onPageLoaded" unloaded="onPageUnloaded" navigatedTo="pageNavigatedTo">
|
||||
<GridLayout>
|
||||
<TextView text="{{ oreintation }}" />
|
||||
<TextView text="{{ orientation }}" />
|
||||
</GridLayout>
|
||||
</Page>
|
||||
|
@ -5,14 +5,14 @@ import pageModule = require("ui/page");
|
||||
var vm = new observable.Observable();
|
||||
function orientationChanged(data) {
|
||||
console.log("Orientation changed: " + data.newValue);
|
||||
vm.set("oreintation", data.newValue);
|
||||
vm.set("orientation", data.newValue);
|
||||
}
|
||||
export function onPageLoaded(args: observable.EventData) {
|
||||
var page = <pageModule.Page>args.object;
|
||||
application.on(application.orientationChangedEvent, orientationChanged, page);
|
||||
|
||||
page.bindingContext = vm;
|
||||
vm.set("oreintation", "not changed");
|
||||
vm.set("orientation", "not changed");
|
||||
}
|
||||
|
||||
export function onPageUnloaded(args: observable.EventData) {
|
||||
|
Reference in New Issue
Block a user