NathanaelA / nativescript-orientation

A NativeScript plugin to deal with Declarative UI and Screen Orientation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cannot get property of undefined

xerotolerant opened this issue · comments

I tried the nativescript-orientation plugin and setOrientation.

var orientation = require('nativescript-orientation');
console.log(JSON.stringify(orientation));// outputs JS: {}
orientation.setOrientation("portrait"); 

However I get the error "Cannot read property setOrientation of undefined".

tns plugin list lists the plugin so I am not sure what I might be doing wrong.

This is with certainty related to the proccess of intalling TNS plugins, as it has some Gotchas.

AHHH! This NativeScript plugin doesn’t work

With the information given in the article, i could solve an identical problem for me.

@xerotolerant - After you do a tns plugin add nativescript-orientation you need to do a tns run ios or tns run android (no other parameters). And it should work fine.