【发布时间】:2014-07-31 12:36:03
【问题描述】:
我创建了一个 Ionic、AngularJS、phonegap/cordova 应用程序。
在我的 index.html 中,我有这个纯 javascript 的 sn-p:
<script src="js/analytics/launchMyApp.js"></script>
<script type="text/javascript">
function handleOpenURL(url) {
// This function is triggered by the LaunchMyApp Plugin
setTimeout(function() {
alert("Hey the URL: " + url);
console.log(">>>>>>>>> Take me to the launchMyApp controller: " + url);
// Call controller function here
}, 3000);
}
</script>
从launchMyApp插件触发handleOpenURL函数:
nl.x-services.plugins.launchmyapp
这是我的控制器:
communicatorApp.controller('LaunchMyAppCtrl', function($scope, $state) {
console.log(">>>>>>>> COOL!!!!");
$scope.launchMyAppHere = function(urlIn) {
console.log(">>>>>>>> GO MAN GO: " + urlIn);
};
});
我的问题是我不知道如何从 index.html javascript 调用 launchMyAppHere 函数?
【问题讨论】:
-
这还不是很清楚。如果您需要帮助,这个问题需要认真检查。
-
查看我接受的答案 - 有人理解我 ;)
标签: javascript angularjs cordova phonegap-plugins