1
내가 등록 뷰를 구축하기 위해 노력하고있어,하지만 내 문제는 사용자가 이미 등록되어있는 경우 점검 문은 다음과 같이, $ionicPlatform.ready
에서 수행하는 것입니다 :이온 등록보기
$ionicPlatform.ready(function() {
db = $cordovaSQLite.openDB({ name: "my.db" });
$cordovaSQLite.execute(db, "CREATE TABLE IF NOT EXISTS groups (id integer primary key, title text)");
if (typeof(Storage) != "undefined") {
// Store
var registered = localStorage["isRegistered"];
if(registered == undefined || !registered){
$location.path('/register');
}else{
$location.path('/tab/groups');
}
}
});
문제 그 $urlRouterProvider.otherwise('/tab/groups')
은 이온 준비가 완료되기 전에 예비 형성됩니다. 이는 응용 프로그램의 첫 번째 개방시 그룹 탭에 나타나고 등록보기로 이동한다는 것을 의미합니다. 사용자가 이미 다음과 같이 달리에 등록되어있는 경우 나는 문 체크를 넣어 시도 : 또한
$urlRouterProvider.otherwise(function($injector, $location){
if (typeof(Storage) != "undefined") {
// Store
var registered = localStorage["isRegistered"];
if(registered == undefined || !registered){
$location.path('/register');
}else{
$location.path('/tab/groups');
}
} });
우리가 열기 전에, 나는 우리가 (데이터베이스에서 그룹을 점점) 그룹 탭에 도착하는 또 다른 문제에 직면 이온 준비 데이터베이스. 등록 할만한 해결책이 있습니까?
그가 볼 수 있습니다 사용자가 이미 등록되어있는 경우 또한, 좋은 해결책이 아니다 레지스터보기 –
로 기본값으로 설정 될 수있다 ionic이 준비 될 때까지 등록보기 –
시작할 스플래시 화면을 사용하고 yourApp.run() 메소드에서 등록 상태를 기반으로하는 경로를 변경하십시오. –