我想以编程方式在单个ng-repeat元素上切换类,但我的代码似乎将其设置为所有元素,并且无法重置它.我怎样才能解决这个问题?
instant.html
<div class="item item-button-right" ng-repeat="service in businessServiceList | filter:services">
{{service.title}}
<div class="buttons" style="padding: 0px">
<button class="button {{buttonStyle}}" ng-click="changeButtonStyle()">
<i class="ion-android-done"></i>
</button>
<button class="button button-stable">
<i class="ion-android-more-horizontal"></i>
</button>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
controller.js
.controller('BookCtrl', function($scope, ServicesData, $stateParams) {
$scope.businessServiceList = ServicesData.getBusinessServiceList ($stateParams.business);
$scope.buttonStyle="button-stable";
$scope.changeButtonStyle = function(){
$scope.buttonStyle="button-positive";
}
})
Run Code Online (Sandbox Code Playgroud) 基本上,我想知道在用户点击时在两个img或div之间切换的最佳方法.因此,首先播放图像是可见的,当用户点击时,隐藏播放图像并显示暂停图像.当用户点击暂停图像时,隐藏暂停图像并显示播放图像.
我尝试使用ng-show但我只能弄清楚如何显示两个图像而不隐藏另一个.因此,播放图像将在暂停图像旁边,这是不理想的.
提前致谢 :)
我试过的代码不起作用:
HTML
<button ng-click="changeStatus" ng-show="checkStatus">Play</button>
<button ng-click="changeStatusAgain" ng-hide="checkStatus">Pause</button>
Run Code Online (Sandbox Code Playgroud)
控制器:
$scope.changeStatus=function(){
$scope.checkStatus = false;
}
$scope.changeStatusAgain=function(){
$scope.checkStatus = true;
}
Run Code Online (Sandbox Code Playgroud)
我需要连接我的离子应用谷歌驱动器,显示所有文件,也许上传,下载,删除,edit.So我试试这个 https://github.com/Raza-Dar/ionic-google-drive2
错误:无法加载资源:服务器响应状态为404(未找到)https://apis.google.com/ / scs/apps-static / /js/k=oz.gapi.en.RArmLpCIYB0.O/m ... 1/ed = 1/am = QQ/rs = AGLTcCOEiG2RgKkKDvOG7y5PZ-fMFMsJXQ/t = zcms/cb = gapi.loaded_01
未捕获的TypeError:无法调用未定义的方法'load'
找不到InAppBrowser插件
这个 http://blog.ionic.io/oauth-ionic-ngcordova/1 在控制台上没有错误......但是在认证之后返回到主页面
这个 http://excellencenodejsblog.com/cordova-ionic-google-oauth-login-for-your-mobile-app/ 用这个我得到用户的信息但不是驱动器中的文件
有什么建议吗?我需要一些工作示例入门代码谢谢
升级到beta.2后.我的应用程序不再运行了.我在浏览器中收到以下错误
未捕获错误:找不到模块"..../project/app/app"
发送两个通知时,第二个通知将覆盖通知中心中的第一个通知.根据文档,这应该只在使用标签时发生:
"tag":指示每条通知消息是否在通知中心上生成新条目.如果未设置,则每个请求都会创建一个新通知.如果已设置,并且已显示具有相同标记的通知,则新通知将替换现有通知.
然而,无论我是否为标签设置了值,这种情况一直发生在我身上.
我甚至尝试设置一个随机标签&collapse_key(据我所知,在这种情况下我不应该相关,但我试了一下).仍然没有帮助.这是我发送的通知对象的示例:
{
"tokens":[
"my-device-token"
],
"profile":"my-profile-tag",
"notification":{
"message":"message",
"android":{
"payload":{
"collapse_key":9918519,
"tag":2825928
}
}
}
}
Run Code Online (Sandbox Code Playgroud) android push-notification google-cloud-messaging ionic-framework firebase-cloud-messaging
在使用firebase进入我的离子应用程序登录facebook后,我面临着收到电子邮件和用户喜欢的问题.在获得Facebook显示名称和用户中的一些其他信息后,没有被重定向到仪表板页面而是登录页面得到刷新.虽然我在stackoverflow和其他的sorces上阅读不同的帖子,但我被卡住了.请帮我解决这两个问题.**1)**如何获取用户的电子邮件和喜欢**2)**如何通过Facebook验证后很快将用户重定向到仪表板..这是代码
****Controller:****
$scope.loginFaceBook = function() {
///alert('fb Login firebase...');
var existingAuthData = Auth.$getAuth();
console.log("existingAuthData : ",existingAuthData);
//console.log("existingAuthData Email : ",existingAuthData.thirdPartyUserData.email);
Auth.$authWithOAuthRedirect("facebook").then(function(authData) {
alert('done 1');
// User successfully logged in
console.log(authData);
$location.path('app/Dash');
}, {
remember: "sessionOnly",
scope: "email,user_likes"
}).catch(function(error) {
if (error.code === "TRANSPORT_UNAVAILABLE") {
Auth.$authWithOAuthPopup("facebook").then(function(authData) {
// User successfully logged in. We can log to the console
// since we’re using a popup here
alert('done 2');
console.log(authData);
$location.path('app/Dash');
}, {
remember: "sessionOnly",
scope: "email,user_likes"
});
} else {
// Another …Run Code Online (Sandbox Code Playgroud) 我是离子,html,角度和java脚本的真正新手.我有一个应用程序,它采用一些JSON数据并显示它ng-repeat.
但是当我试图切换到下一张幻灯片时,它会重叠.我有一个$ interval,每5秒刷新一次JSON,它也重置为第一张幻灯片.
这里的HTML:
<ion-view title="home">
<ion-content ng-controller="temperatureCtrl">
<div ng-init="init()"></div>
<ion-slides options="options" slider="data.slider" >
<ion-slide-page ng-repeat="channel in channels">
<div class="list">
<h2><center>canal# {{channel.canal}}</center></h2>
<br/>
<center>
<button class="button button-stable" ng-click="switchChannel(channel, channel.canal)" ng-model="channel.status">
{{channel.status}}
</button>
</center>
<div class="list">
<label class="item item-input">
<input type="text" style="text-align:center;" placeholder="Channel name" ng-model="channel.name" ng-focus="stopRefresh()" ng-blur="restartRefresh()">
</label>
</div>
<h4><center>
<span class="Ainput" ><h3>{{channel.temperature}}ºC</h3></span>
</center></h4>
<h3><center>Setpoint= {{channel.setPoint}}</center></h3><br>
<div class="item range range-positive">
<i class="icon ion-minus-round"></i>
<input type="range" name="setpoint" min="5" max="30" step="0.5" value="33" ng-model="channel.setPoint" ng-focus="stopRefresh()" ng-blur="restartRefresh()">
<i class="icon ion-plus-round"></i>
</div>
<centrer>
<button …Run Code Online (Sandbox Code Playgroud) $font-family-baseIonic2中的变量不起作用.
在app.variable.scss文件中我添加了一个新值,但旧值仍然存在.
其他变量如$font-size-base工作正常
这些是我建造的最大任务www:
gulp.task("fonts", function () {
return copyFonts({
src: [
"app/fonts/**/*.+(eot|ttf|woff|woff2|svg)"
]
});
});
gulp.task("sass", function () {
return buildSass({
sassOptions: {
includePaths: [
"node_modules/ionic-angular",
"node_modules/ionicons/dist/scss"
]
}
});
});
Run Code Online (Sandbox Code Playgroud)
我错过了什么?
那是我的字体
@font-face {
font-family: "Maven Pro";
font-style: normal;
font-weight: 400;
src: local("Maven Pro"), local("Maven-Pro-Regular"), url("#{$font-path}/MavenPro-Regular.ttf") format("truetype");
}
@font-face {
font-family: "Maven Pro";
font-style: normal;
font-weight: 500;
src: local("Maven Pro Medium"), local("Maven-Pro-Medium"), url("#{$font-path}/MavenPro-Medium.ttf") format("truetype");
}
@font-face {
font-family: "Maven Pro"; …Run Code Online (Sandbox Code Playgroud) 我一直在与离子工作一段时间,并且在各种文献中,我已经看到这些命令用于添加android平台.
有人可以告诉我使用这两者与提供哪些优点/缺点以及通常应该使用哪一个之间的区别?