4
嗨我試圖在cordova應用程序中使用torii。我的environment.js文件如下所示。我無法訪問窗口文檔對象來設置redirectUri。獲取錯誤未定義的變量。我怎樣才能訪問窗口文檔對象。在炭燼環境中訪問窗口對象
module.exports = function (environment) {
var ENV = {
environment: environment,
baseURL: '/',
locationType: 'hash',
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. 'with-controller': true
}
},
APP: {
// Here you can pass flags/options to your application instance
// when it is created
},
torii: {
providers: {
'facebook-oauth2': {
apiKey: '2xxxxxxxxxx',
redirectUri: document.location.href
},
}
},
cordova: {
rebuildOnChange: false,
rebuildAsync: false,
emulate: false
}
};
在我.jshintrc
"predef": {
"document": true,
"window": true,
"AuthENV": true
}
所以我假設文件應該是全球可用的,但它不是
你如何使用'window'和'document'對象 - 你能提供一個樣本嗎? – bonesbrigade 2015-09-19 23:26:22
redirectUri:document.location.href // here – Rigel 2015-09-20 03:37:54