我在传单地图上的默认放大/缩小按钮时遇到一些问题.当我直接加载页面时,一切正常,但是当我将一个状态更改为leaflet指令是按钮的状态时,就是不起作用.在这里你举个例子
http://codepen.io/anon/pen/JkyEg?editors=101
代码:
HTML
<html ng-app="app">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"/>
<link href="http://code.ionicframework.com/1.0.0-beta.11/css/ionic.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<title>Leaflet example</title>
</head>
<body>
<ion-nav-view></ion-nav-view>
<script type="text/ng-template" id="locations.html">
<ion-view title="Locations">
<ion-content>
<ion-list can-swipe="true">
<ion-item ng-click="locationOnClick(location)" class="item item-icon-left" ng-repeat="location in locations">
<i class="icon ion-location"></i>
<h2>{{location.name}}</h2>
</ion-item>
</ion-list>
</ion-content>
</ion-view>
</script>
<script type="text/ng-template" id="location.html">
<ion-view title="{{location.name}}">
<ion-nav-bar class="bar-positive" animation="nav-title-slide-ios7">
<a ui-sref="locations" class="button icon-left ion-chevron-left button-clear ">Locations</a>
</ion-nav-bar>
<ion-content>
<leaflet height="480px"></leaflet>
</ion-content>
</ion-view>
</script>
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<script src="http://code.ionicframework.com/1.0.0-beta.11/js/ionic.bundle.min.js"></script>
<script src="http://tombatossals.github.io/angular-leaflet-directive/dist/angular-leaflet-directive.min.js"></script>
</body> …Run Code Online (Sandbox Code Playgroud) 我们正在尝试在我们最新的Ionic Framework/AngularJS项目中使用此Codepen,似乎无法解决这个问题.
我们希望能够点击"查找我们"并让Google地图标记显示我们当前的位置.
如果有人能看到我们出错的地方,请告诉我们.谢谢.
// Google Map
.controller('MapCtrl', function($scope, $ionicLoading, $compile) {
function initialise() {
var myLatlng = new google.maps.LatLng(53.068165,-4.076803);
var mapOptions = {
zoom: 15,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP,
}
var map = new google.maps.Map(document.getElementById('map'), mapOptions);
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
});
$scope.map = map;
}
google.maps.event.addDomListener(window, 'load', initialise);
$scope.centerOnMe = function() {
if(!$scope.map) {
return;
}
$scope.loading = $ionicLoading.show({
showBackdrop: true
});
navigator.geolocation.getCurrentPosition(function(pos) {
$scope.map.setCenter(new google.maps.LatLng(pos.coords.latitude, …Run Code Online (Sandbox Code Playgroud) 我正在使用Ionic编写PhoneGap/Cordova应用程序,并使用SQLite(使用ngCordova)进行持久存储.应用程序的核心是从SQLite数据库中检索的项目的滚动列表.
listController.js
.controller('ListCtrl', [
'$scope',
'dataFactory',
function($scope, dataFactory) {
var items = dataFactory.getAllItems().then(function(data){
$scope.allItems = data;
});
}
]);
Run Code Online (Sandbox Code Playgroud)
dataFactory.js
.factory('dataFactory', [function($window, $log, $q, $cordovaSQLite, dummyDataGenerator){
var db_;
// ...lots of SQLite fun in here
// cascading async callbacks to load the database and inject dummy data
var openDB_ = function(){...};
var createTable_ = function(){...};
// etc
var getAllItems = function(){
var q = $q.defer();
$cordovaSQLite.execute(db_, sqlSelectString, []).then(
function(results) {
$log.log("SQL SELECT successful");
var i, len, allItems = [];
for(i …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用MovilizerJS和Ionic Framework来创建HTML5屏幕.我尝试从Ionic生成的App.js文件中引用te MovilizerJS.我在plugins文件夹中添加了MovilizerJS文件,并添加了包含的Cordova.js文件.
var oHead = document.getElementsByTagName('HEAD').item(0);
var oScript = document.createElement("script");
oScript.type = "text/javascript";
oScript.src = "plugins/Movilizer.js";
oHead.appendChild(oScript);
Run Code Online (Sandbox Code Playgroud)
看来,当我在浏览器中加载HTML5页面(或在movelet中的html5视图)时,MovilizerJS不会被加载.浏览器上显示以下错误:
模块'movilizer'不可用!
也许我需要将此作为模块添加到Angular Framework中,但是当我尝试将其添加到模块时,它仍然会给我带来错误.我的HTML文件包含movilizer的脚本标记:
<script src="plugins/Movilizer.js"></script>
Run Code Online (Sandbox Code Playgroud)
我的App.js代码目前看起来像这样:
angular.module('starter', ['ionic'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if(window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if(window.StatusBar) {
StatusBar.styleDefault();
}
});
}).factory('MovilizerExtender', function ($rootScope) {
return {
startUpMovilizer: function(){
movilizer.readGlobalVariable("testTable",this.successCallback,this.errorCallback);
},
successCallback: function(result){
$rootScope.routestops = [
{ ontvNaam: …Run Code Online (Sandbox Code Playgroud) 我想问一下是否有人尝试过使用带有AR的Ionic Framework,比如Wikitude或ezAR?我是这个特定领域的新手,我不知道如何开始.非常感谢
我有一个textangular作为元素的视图.在Android(我测试过)上,如果键盘打开,视图不会向上滚动以防止编辑器进入键盘.我安装了Keyboard插件com.ionic.keyboard.
这是页面的结构:
<ion-view id="newblogview">
<ion-nav-buttons side="left">
...
</ion-nav-buttons>
<ion-content scroll="true" overflow-scroll="true" class="has-header" delegate-handle="mainScroll">
<iframe data-tap-disabled="true" style="width: 100%; min-height: 100%" src="./templates/blog/html/blog-editor.html" name="blogeditor" id="blogeditor"></iframe>
</ion-content>
</ion-view>
Run Code Online (Sandbox Code Playgroud)
通过聚焦输入打开键盘时,它不会向上移动.我试过android:windowSoftInputMode ="adjustPan"以及"adjustResize"而且我也尝试过native.keyboardshow事件来调用$ ionicScrollDelegate.scrollBottom(true);
我认为我们已经为页脚添加了键盘附加指令,但是我无法在页脚中放置文本编辑器.离子框架是否支持调整键盘显示/隐藏的离子含量?是否在框架中不支持此功能或我错过了什么.
这个问题类似于另一个主题,但没有接受的答案.
请帮忙.-Prakash.
当我跑步时,ionic build android --release
我得到一个错误
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
Run Code Online (Sandbox Code Playgroud)
我想表明4 ion-items我ion-list在一排.
由于我使用的是Bootstrap,我试图这样做:
<button class="col-sm-3" ion-item *ngFor="let player of players">
<ion-avatar item-left>
<img [src]="user.photoURL">
</ion-avatar>
{{ user.name }}
</button>
Run Code Online (Sandbox Code Playgroud)
但它不起作用.
我试图找出从代码传递到最终可部署的apk/ipa 的最佳进程.
到目前为止,我有一个使用Karma + Jasmine的测试套件,它将TypeScript转换为JS并运行一些单元测试.我通过gulp开始这个过程.
之后,我所知道的是ionic build android --release生成(一个未签名的)apk.但我不确定生成的apk是如何被模仿/缩小的.
所以,请记住代码必须尽可能私密,是ionic build足够的缩小和模仿,还是应该通过gulp手动完成所有这些预建任务?在这种情况下,什么是我应该运行的正确任务,我是否必须手动将所有TypeScript文件转换为JS?我应该以什么顺序执行任务?
例如transpile -> tests -> minify -> uglify -> build apk或minify -> uglify -> transpile -> tests -> build apk
我有点迷失了,我唯一可以弄清楚的是测试应该先运行,因为测试失败的情况应该中止该过程.
我一直致力于一个项目,以便最近加快Ionic3的所有变化.它主要基于Ionic-Team的演示会议应用程序.
我仍然试图倾斜角度/离子,我让大多数应用程序在ionic2中运行.共享components.module延迟加载搞砸了我一段时间.但现在我在自定义组件中使用Ionic的内置组件时遇到了问题.我正在尝试构建一个使用ion-card的自定义组件来显示通过@Input传递给它的信息.
它给出的错误:
Error: Template parse errors:
'ion-card-header' is not a known element:
1. If 'ion-card-header' is an Angular component, then verify that it is part of this module.
2. If 'ion-card-header' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<ion-card>
[ERROR ->]<ion-card-header>
<h3>{{ recipe.title }}</h3>
</ion-card-header>
"): ng:///ComponentsModule/RecipeCardComponent.html@3:2
'ion-card-content' is not a known element:
1. If 'ion-card-content' is an Angular component, then verify that it is part …Run Code Online (Sandbox Code Playgroud) ionic-framework ×10
angularjs ×5
cordova ×3
angular ×2
ionic ×2
ionic2 ×2
ionic3 ×2
javascript ×2
android ×1
build ×1
google-maps ×1
gradle ×1
gulp ×1
html5 ×1
ionic-view ×1
jvm ×1
leaflet ×1
movilizer ×1
sass ×1
sqlite ×1
typescript ×1
wikitude ×1