我一直在寻找如何使用较新的基于Django类的视图方法在一个页面上显示2个独特的表单.
任何人都可以参考吗?或者提供一个基本的例子.谷歌不是我的"朋友".
寻找更新的解决方案,运行使用Cordova 5.x的最新离子1.1.0版本.试图能够浏览Chrome中的网站,并使用网络意图将该网址发送到我的离子Android应用程序.我的应用程序编译和运行,但是当我尝试使用份额从功能铬(或任何其他应用程序),然后选择我的应用程序分享给我的应用程序崩溃.
我首先尝试使用插件:
离子插件添加https://github.com/Initsogar/cordova-webintent
然后删除了插件,我也尝试了一个最近更新的fork:
离子插件添加https://github.com/fluentstream/cordova-webintent
在我的app.js文件中,我输入以下代码:
.run(function($ionicPlatform, $rootScope, $ionicHistory, $state) {
$ionicPlatform.ready(function() {
window.plugins.webintent.getExtra(window.plugins.webintent.EXTRA_TEXT,
function(url) {
incomingURL = url;
//alert(incomingURL);
console.log(incomingURL);
}, function() {
incomingURL = false;
//alert("no url");
console.log("no url");
});
});
})
Run Code Online (Sandbox Code Playgroud)
我也尝试过:
.run(function($ionicPlatform, $rootScope, $ionicHistory, $state) {
$ionicPlatform.ready(function() {
window.plugins.webintent.getUri(function(url) {
if(url !== "") {
alert(url);//url is the url the intent was launched with
}
});
});
})
Run Code Online (Sandbox Code Playgroud)
在文件config.xml中我会放:
<plugin name="WebIntent" value="com.borismus.webintent.WebIntent"/>
Run Code Online (Sandbox Code Playgroud)
在AndroidManifest.xml中我会手动输入:
<activity android:name="ShareActivity">
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" …Run Code Online (Sandbox Code Playgroud)