I'm going to use nativescript-orientation plugin in my project. https://github.com/NathanaelA/nativescript-orientation#argslandscape--true--false
I want to change all layout when orientation changes automatically. So I'm going to use this function.
exports.orientation(args)
args.landscape = true | false
args.page (depreciated) or args.object = the current page
But I don't know how to insert it in my typescript & angluar 2 project.
import { Component, OnInit } from "@angular/core";
var Orientation = require( "nativescript-orientation" );
@Component({
selector: "my-app",
templateUrl: "app.component.html",
})
export class AppComponent implements OnInit {
public counter: number = 16;
public get message(): string {
if (this.counter > 0) {
return this.counter + " taps left";
} else {
return "Hoorraaay! \nYou are ready to start building!";
}
}
ngOnInit(){
console.log(Orientation.getOrientation()+"--phone");
}
public onTap() {
this.counter--;
}
}
export function orientation(args){
}