让我们尽量让它变得简单。尽管Firebase已进行更改,但我的观点仍未更新。我试图在这里和那里使用回调函数没有运气,它似乎不需要在这里,但我的视图不会更新,直到页面刷新。我每次点击一个按钮时都试图实现一个计数器。
查看
//The selected is just because I needed to select the key to show the correct
//values in the view
<div class="row"><div class="onehundred">{{hc.selected.counter}}</div>
<span class="onehundreddonuts"> donuts</span></div>
控制器
function incrementCounter() {
//I have tried wrapping this in a .then(function(){}) callback function based
//on the self.player.$loaded() but this doesn't fix anything, so I took it out
//for simplicity. If I console.log my self.player = homeService.player array
//it prints it out correctly anyway.
homeService.incrementCounter();
}
服务
function incrementCounter() {
self.counter ++;
self.update();
}
function update() {
self.player.$save(key);
}
答案 0 :(得分:0)
我发现这可以在类似情况下提供帮助:
** BUILD FAILED **
The following build commands failed:
CompileC build/App.build/Debug-iphonesimulator/App.build/Objects-normal/i386/IonicKeyboard.o App/Plugins/com.ionic.keyboard/IonicKeyboard.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/me/Documents/app/platforms/ios/cordova/build-debug.xcconfig,-project,app.xcodeproj,ARCHS=i386,-target,app,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/me/Documents/app/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/me/Documents/app/platforms/ios/build/sharedpch
OSX 10.11.3
XCode 7.2.1 (7C1002)
ionic -v
1.7.14