1)Angular services依赖注入的规范:自定义的service要写在内建的Angular services之后,自定义的service之间是没有先后顺序的
2)ionic1.3之后页面为了提供性能加入了缓存机制,如果不需要可以在配置页面时将cache属性设为false
$stateProvider.state('safetyAdd', {
cache: false,
url: "/safetyAdd",
templateUrl: "templates/safety/safetyAdd.tpl.html",
controller: 'safetyAdd'
});
3)强制刷新
$timeout( function() {
$scope.$parent.$broadcast( "$ionicView.enter" );
//$rootScope.$broadcast("$ionicView.enter");
2)ionic1.3之后页面为了提供性能加入了缓存机制,如果不需要可以在配置页面时将cache属性设为false
$stateProvider.state('safetyAdd', {
cache: false,
url: "/safetyAdd",
templateUrl: "templates/safety/safetyAdd.tpl.html",
controller: 'safetyAdd'
});
3)强制刷新
$timeout( function() {
$scope.$parent.$broadcast( "$ionicView.enter" );
//$rootScope.$broadcast("$ionicView.enter");
});
4)执行ionic run android时,有时会报错:Error executing "adb devices": error
将adb服务kill掉就好了:adb kill-server
5)imagePicker默认是英文的,如果要改中文需要修改源文件。platform/android/下的
6)media默认android录音生成的只能是amr类型文件,这种格式在ios下是无法播放的,改为m4a格式,修改源码