我正在尝试使用ngCordova 的" https://github.com/danwilson/google-analytics-plugin.git "插件.我添加了插件并在控制器中添加了ngCordova作为依赖项.
当我尝试设置:
$cordovaGoogleAnalytics.startTrackerWithId('UA-XXXXXXXX-X');
Run Code Online (Sandbox Code Playgroud)
我收到此错误:'TypeError:无法读取'undefined'属性'startTrackerWithId'.
我已将分析设置为Google信息中心中的移动应用.
任何人都可以帮忙吗?
我想要一个iframe来填充导航栏下方的所有空间.我看到Ionic正在生成内联CSS并向html,body标签添加类,它还创建了div包装器.我不知道达到我想要的目的是什么.我需要为此使用一些预制的CSS类,还是自己编写?如果是这样,我该怎么做,不打破布局.
问题不是关于iframe,而是关于让容器填满导航栏下面的整个空间.
目前iframe占据全宽但只有150像素的高度,因为父容器的高度为150px.
我的应用程序基于(github的标签应用程序).
我的代码如下:
index.html的:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
</head>
<body ng-app="starter">
<ion-nav-bar class="bar-stable">
<ion-nav-back-button>
</ion-nav-back-button>
</ion-nav-bar>
<ion-nav-view style="width: 100%; min-height: 100%; height: 100%;">
<!-- tab-map is shown here: -->
</ion-nav-view>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
制表map.html:
<ion-view view-title="Map" style="width: 100%; min-height: 100%">
<div style="width: 100%; min-height: 100%">
<ion-content class="padding" >
<iframe src="../index.html" style="width: 100%; min-height: 100%">
</iframe>
</ion-content>
</div>
</ion-view>
Run Code Online (Sandbox Code Playgroud)
目前它看起来像这样:

我试图在标题栏的右侧添加一个按钮,按钮显示,但ng-click不会被触发,如果我在离子内容中移动按钮,它开始工作,只是不在标题中工作.
HTML:
<ion-view>
<ion-nav-bar class="bar-stable nav-title-slide-ios7" >
<ion-nav-back-button class="button-icon icon ion-ios7-arrow-back">
</ion-nav-back-button>
</ion-nav-bar>
<ion-header-bar>
<h1 class="title">Trips</h1>
<div class="buttons pull-right"><button class="button button-icon icon ion-plus" ng-click="createTrip()"></button></div>
</ion-header-bar>
<ion-content>
</ion-content>
</ion-view>
Run Code Online (Sandbox Code Playgroud)
JS:
.controller('TripCtrl', function($scope, $location, $localStorage){
console.log('inside TripCtrl');
$scope.$storage = $localStorage;
var random1 = {
name : 'random name 1',
text : 'random text 1'
}
var random2 = {
name : 'random name 2',
text : 'random text 2'
}
$scope.trips = [];
$scope.trips.push(random1);
$scope.trips.push(random2);
$scope.createTrip = function(){
console.log('clicked create new');
$location.path('/createTrip'); …Run Code Online (Sandbox Code Playgroud) 我有一个带有MASTER分支的git存储库.我现在有一个新功能到同一个git项目的特定分支.
我想添加特定的分支cordova插件.
我知道添加了一个基于GIT和GIT TAGS的cordova项目,但我找不到与分支相关的任何内容.
我正在寻找类似的东西:
cordova plugin add https://mygitadresse/myproject#branch_name
Run Code Online (Sandbox Code Playgroud)
感谢支持和建议;
每个人我正在使用Ionic我尝试将文件发送到我的服务器,但我有一个表格数据的问题,它在追加后仍然是空的,当我在控制台检查它时认为我发现它是空的并且没有数据插入我的数据库.
PS: 我使用了很多输入文件.
这是控制器:
.controller('perProfil', function($scope, annonceService, TDCardDelegate, $timeout, $http, $rootScope) {
$scope.data = {}
$scope.uploadedCin = function(element) {
$scope.$apply(function($scope) {
var files = element.files;
$rootScope.cin = files[0];
})
}
$scope.uploadedbultin = function(element) {
$scope.$apply(function($scope) {
var files = element.files;
$rootScope.bult = files[0];
$rootScope.FormData.append("bult", files[0]);
})
}
$scope.uploadedavis = function(element) {
$scope.$apply(function($scope) {
var files = element.files;
$rootScope.avis = files[0];
})
}
$scope.uploadedCertif = function(element) {
$scope.$apply(function($scope) {
var files = element.files;
$rootScope.certif = files[0];
console.log($rootScope.certif);
})
}
$scope.uploadedFile = …Run Code Online (Sandbox Code Playgroud) 有没有人在Android/iOS中使用具有完全离线功能的Firebase实现原生应用?
这可以通过使用原生Firebase SDK的插件在Cordova/Ionic中完成吗?
我们正在构建一个在下载和首次启动时具有连接的应用程序但是我们必须假设一段时间内没有更多的互联网连接,并且数据库中的所有内容都必须可以脱机使用.Firebase是否适合此要求,还是我们必须使用CouchDB/PouchDB或任何其他替代方案?
编辑:
这个问题提到了firebase实时数据库.我相信,随着新的firebase Cloud Firestore离线功能的开箱即用:
https://firebase.google.com/docs/database/rtdb-vs-firestore
实时数据库:仅针对iOS和Android上的移动客户端提供离线支持.
Cloud Firestore:对iOS,Android和Web客户端的脱机支持.
当我在我的iOS设备上运行它时,我的设备已经在我的离子应用程序中不会触发或触发
ionic run ios --device -lcs
Run Code Online (Sandbox Code Playgroud)
我删除了所有插件ionic plugin rm ...,删除了plugins/目录的内容并重新安装它们.我还删除并重新安装了ios平台ionic platform rm/add ios.
我坚持这个.
iPhone(6+)在iOS 10上.
我正在使用离子1和最后一个离子CLI.
编辑:我逐个删除了所有插件,似乎问题是由于cordova-plugin-network-information和cordova-plugin-device.
Process 663 detached
(lldb)
(node:26790) DeprecationWarning: Using Buffer without `new` will soon stop working. Use `new Buffer()`, or preferably `Buffer.from()`, `Buffer.allocUnsafe()` or `Buffer.alloc()` instead.
14 030280 warn Native: deviceready did not fire within 2000ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.
15 030605 info …Run Code Online (Sandbox Code Playgroud) 我试图将数据发布到soap api但无法这样做.我已经尝试了所有可能的方法但仍然在调用api时出错.
我的api是 - http://xyz.asmx?op = UserRegistration
并且它以xml格式排除数据
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<UserRegistration xmlns="http://Service/">
<Usercreditional>string</Usercreditional>
</UserRegistration>
</soap:Body>
</soap:Envelope>
Run Code Online (Sandbox Code Playgroud)
我尝试过的事情 -
1>使用$ http.post
var soapData = '<?xml version="1.0" encoding="utf-8"?>'+
'<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">'+
'<soap:Body>'+
'<UserRegistration xmlns="http://Service/">'+
'<Usercreditional>[{ \'DeviceUUID\': \'' + data.DeviceUUID + '\', ' +
"\"DevicePushID\":\"" + data.DevicePushID + "\"}]" +
'</Usercreditional></UserRegistration></soap:Body></soap:Envelope>';
return $http({
method: 'POST',
url: ' http://xyz.asmx?op=UserRegistration',
data : soapData,
headers : { "Content-Type" : 'application/xml'}
});
Run Code Online (Sandbox Code Playgroud)
这给出错误"无法处理请求.--->根元素丢失"
2>使用SOAPClient
var deferred = $q.defer();
var soapParams …Run Code Online (Sandbox Code Playgroud) 我有以下代码段.在手机屏幕是小,它会无法显示所有7个选项卡一次.因此,它将显示为两行不明显的选项卡.
我想要的选项卡,当滚动页面到右边或左边的末尾时,它可以处理溢出,以便用户会注意到那里有标签.
示例是java中android 的scroollable选项卡.但是,我需要它在离子1中.让我们说移动屏幕能够显示7个标签中的3个标签.当我向右滚动选项卡(第三个选项卡)时,第四个选项卡将显示在右侧,第三个选项卡现在将位于中间选项卡上,而第二个选项卡将显示在右侧.
请在代码段中显示代码,以便我们可以直观地知道它正在运行.
angular.module('ionicApp', ['ionic'])
.controller('MyCtrl', function($scope,$ionicSlideBoxDelegate) {
$scope.slideIndex = 0;
// Called each time the slide changes
$scope.slideChanged = function(index) {
$scope.slideIndex = index;
};
$scope.activeSlide = function (index) {
$ionicSlideBoxDelegate.slide(index);
};
});Run Code Online (Sandbox Code Playgroud)
body {
cursor: url('https://ionicframework.com/img/finger.png'), auto;
}
.slide-tab{
display: table;
overflow: hidden;
margin: 0;
width: 100%;
background-color: #eff0f2;
border-bottom: 2px solid #00897B;
}
.slide-tab li{
float: left;
line-height: 38px;
overflow: hidden;
padding: 0;
}
.slide-tab …Run Code Online (Sandbox Code Playgroud)我正在尝试在AWS s3上传图像,因为我正在使用@ ionic-native/file-transfer但是当我尝试添加FileUploadOptions时,我会收到错误.FileTransfer和FileTransferObject不会发生错误.我需要FileUploadOptions.paramsAWS s3.
注意:我查看了node_modules/@ ionic-native/file-transfer,注释了一些FileUploadOptions代码.这是一个问题吗?有谁知道任何其他稳定的文件传输版本.我现在不在乎
我已经使用这些命令安装了脚本
$ ionic cordova plugin add cordova-plugin-file-transfer
$ npm install --save @ionic-native/file-transfer
Run Code Online (Sandbox Code Playgroud)
比我更新了我的app.module.ts:
import { FileTransfer, FileUploadOptions, FileTransferObject } from '@ionic-native/file-transfer';
Run Code Online (Sandbox Code Playgroud)
在app.module.ts的提供者数组中:
providers: [
StatusBar,
FileUploadOptions,
FileTransfer,
FileTransferObject,
File,
Camera,
SplashScreen,
{
provide: ErrorHandler,
useClass: IonicErrorHandler
},
{
provide: AuthHttp,
useFactory: getAuthHttp,
deps: [Http]
},
DataServiceProvider,
LocationServiceProvider,
Geolocation,
JwtHelper,
AuthServiceProvider
]
Run Code Online (Sandbox Code Playgroud)
当我在我的提供者数组中添加FileUploadOptions时,我收到此错误:
Typescript错误'FileUploadOptions'仅引用类型,但在此处用作值.C:/xampp/htdocs/ionic/tellworld-mobile/src/app/app.module.ts StatusBar,FileUploadOptions,FileTransfer,
的package.json:
"dependencies": {
"@angular/common": "4.1.3",
"@angular/compiler": "4.1.3",
"@angular/compiler-cli": "4.1.3",
"@angular/core": "4.1.3",
"@angular/forms": "4.1.3", …Run Code Online (Sandbox Code Playgroud)