<ion-slide-box active-slide="index">
<ion-slide ng-repeat="photo in photoes">
<img ng-src="{{photo.url}}">
</ion-slide>
</ion-slide-box>
Run Code Online (Sandbox Code Playgroud)
我不希望幻灯片显示分数.怎么做到这一点?
如果有人可以告诉我?
myApp.services.factory('GCMHelper', ($q)->
pushNotification = {}
_init = ()->
defer = $q.defer()
ionic.Platform.ready(()->
pushNotification = window.plugins.pushNotification;
window.onNotification = (res)->
console.log('onNotification', res)
defer.resolve()
)
return defer.promise
return {
register: ()->
_init().then(()->
pushNotification.register(
(res)->
console.log('gcm register success', res)
(err)->
console.log('gcm register err', err)
{
"senderID": "*********",
"ecb": "onNotification"
}
);
)
}
)
Run Code Online (Sandbox Code Playgroud)
在控制器中:
GCMHelper.register()
Run Code Online (Sandbox Code Playgroud)
(请原谅我可怜的英语)我将Cordova PushPlugin与Cordova 4.2和Ionic beta 14联系起来,每次用"OK"字符串获得成功回调,但ecb onNotification从未被解雇,并且在控制台没有错误.我几乎没有理想......,任何一个帮助?
angularjs cordova google-cloud-messaging cordova-plugins ionic
我有关于混合移动使用离子 - cordova-angular的问题.关于问题离子滑动盒的问题下面没有按钮.我试图在用户快速浏览幻灯片页面时获取当前索引.
如何获得当前索引没有我创建按钮下一张幻灯片.
MacBook-Pro:myApps naveenkumar$ ionic run ios
Adding in default Ionic hooks
Running command: /Users/naveenkumar/Documents/ionic_work/myApps/hooks/after_prepare/010_add_platform_class.js /Users/naveenkumar/Documents/ionic_work/myApps
add to body class: platform-ios
Running command: /Users/naveenkumar/Documents/ionic_work/myApps/hooks/after_prepare/020_remove_sass_from_platforms.js /Users/naveenkumar/Documents/ionic_work/myApps
Running command: /Users/naveenkumar/Documents/ionic_work/myApps/platforms/ios/cordova/run
Cordova needs ios-sim version 3.0.0 or greater, you have version 1.9.0
.
ERROR running one or more of the platforms: Error: /Users/naveenkumar/Documents/ionic_work/myApps/platforms/ios/cordova/run: Command failed with exit code 2
You may not have the required environment or OS to run this project
MacBook-Pro:myApps naveenkumar$
Run Code Online (Sandbox Code Playgroud)
您好,我正在尝试从终端运行我的项目.我收到了上述错误.但是,当我去给定的iOS目录从Xcode运行我的项目时它工作正常.这意味着,当我从Xcode运行时,我能够运行模拟器/模拟器并检查我的输出.但是当我从终端运行时,我无法运行我的应用程序.你能告诉我如何从终端运行我的应用程序吗?
谢谢
我有一个非常小的Ionic应用程序我一直在努力(只有几个有角度的路线/视图).当我使用"离子服务"运行它时,应用程序按预期加载到我的浏览器中.但是,当我使用"离子上传"上传它并在Ionic View应用程序中查看它时,看起来好像我的javascript都没有工作,或者我的路线无效.
我该如何调试此问题?是否有构建工具来检测错误或其他任何行?
嗨,我正在使用离子侧菜单创建一个应用程序,我需要记住登录用户,我将保存用户名和密码,就像这样.
window.localStorage['rem'] = 'yes';
window.localStorage['Username'] = $scope.loginData.username;
window.localStorage['password'] =$scope.loginData.password;
Run Code Online (Sandbox Code Playgroud)
保存功能工作正常,问题是我试图读取保存的数据,而启动应用程序控制器没有调用.如何在离子侧菜单应用程序中加载登录页面时调用控制器?
提前致谢
我是离子应用程序开发的新手.我只是在他们的网站上使用离子样本项目.但问题是它在浏览器中运行良好.但是不能从设备上的服务器加载数据.
错误消息显示
无法加载资源:服务器响应状态为404(未找到)
我正在尝试resume在应用程序恢复时观看该事件.我以前有这个工作,但离子改变了事情,现在我遇到了麻烦.我相信这很容易解决.
这曾经工作但不再适用:
$ionicPlatform.on('resume', function(){
//rock on
});
Run Code Online (Sandbox Code Playgroud)
该文档现在建议使用以下,但我不知道要使用的DOM元素.
angular.module('starter', ['ionic', 'starter.controllers'])
.run(function() {
ionic.Platform.ready(function() {
ionic.on('resume', function(){
//rock on
}, element);
});
});
Run Code Online (Sandbox Code Playgroud)
此外,该ionic.on()功能应该在ionic.Platform.ready()功能中吗?
我试图在我的angularjs项目中迭代来自Web服务的数据.我遇到的问题是:
在我的控制台日志中,它显示每个项目的信息,但是当我尝试在我的html上显示它时,它只显示数据的最后一项?
HTML
<ion-item ng-repeat="item in documents">{{item}}</ion-item>
Run Code Online (Sandbox Code Playgroud)
如果我像这样添加项目的ID:
<ion-item ng-repeat="item in documents">{{item.id}}</ion-item>
Run Code Online (Sandbox Code Playgroud)
它只显示与数据量相同的空格.我认为数据存在,但没有显示任何字符串值.
JS
.controller('DashCtrl', function($scope, $http) {
$http.get("http://localhost:15021/Service1.svc/getAllTrucks")
.success(function(data) {
var obj = data;
var ar = [];
angular.forEach(obj, function(index, element) {
angular.forEach(index, function(indexN, elementN) {
ar = {id: indexN.QuoteID, quotenum: indexN.QuoteNumber};
console.log(ar);
});
$scope.documents = ar;
});
console.log(data);
})
.error(function(data) {
console.log("failure");
});
Run Code Online (Sandbox Code Playgroud)
我想要完成的是用一个数据列表填充应用程序.谢谢.(如果事情没有任何意义请问)
我正在使用Ionic中的示例中的幻灯片菜单.当我从任何页面(使用$ location或$ state.go)重定向到主页时,菜单被禁用.它不能再显示了.
$state.go('app.home');
$location.path('/#/app/home');
Run Code Online (Sandbox Code Playgroud)
知道发生了什么事吗?
这是菜单模板
<ion-side-menus>
<ion-side-menu-content drag-content="true">
<ion-nav-bar class="bar-dark">
<ion-nav-back-button>
</ion-nav-back-button>
<ion-nav-buttons side="left">
<button class="button button-icon button-clear ion-navicon" menu-toggle="left">
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-nav-view name="menuContent"></ion-nav-view>
</ion-side-menu-content>
<ion-side-menu side="left">
<ion-header-bar class="bar-light">
<h1 class="title">Title</h1>
</ion-header-bar>
<ion-content>
<ion-list>
<ion-item menu-close href="#/app/login">
Login
</ion-item>
<ion-item menu-close href="#/app/account">
Account
</ion-item>
<ion-item menu-close href="#/app/logout">
Logout
</ion-item>
</ion-list>
</ion-content>
</ion-side-menu>
</ion-side-menus>
Run Code Online (Sandbox Code Playgroud)
这是应用程序的配置
$stateProvider
.state('app', {
url: "/app",
abstract: true,
templateUrl: "templates/menu.html"
})
.state('app.home', {
url: "/home",
views: {
'menuContent@app': {
templateUrl: "modules/home/views/home.html",
controller: 'HomeCtrl'
} …Run Code Online (Sandbox Code Playgroud)