0
이온 프레임 워크의 각도 탐색에 문제가 있습니다. 두 페이지 (주)를 설정했으며 앱을 열면 첫 번째 상태가 표시됩니다. 그러나 $ urlRouterProvider.otherwise은 작동하지 않습니다 (적어도 문제라고 생각합니다).
나는 oficial documentation과 일부 tutorials을 따라 갔지만 아무것도 만들지 못했습니다. 저를 도와주세요?
var app = angular.module('famousguess', ['ionic', 'ui.router'])
app.config(function($stateProvider, $urlRouterProvider) {
\t
\t $stateProvider
\t .state('welcome', {
\t \t url: '/',
\t \t templateUrl: 'views/welcome.html',
\t \t controller: 'WelcomeCtrl'
\t })
\t .state('grid', {
\t \t url: '/grid/:gridid',
\t \t templateUrl: 'views/grid.html',
\t \t controller: 'GridCtrl'
\t });
\t
\t $urlRouterProvider.otherwise('/');
});
app.controller('WelcomeCtrl', function ($scope, $state) {
\t
}
app.controller('GridCtrl', function ($scope, $stateParams, $ionicHistory) {
\t
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title>Famous Guess</title>
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->
<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>
<!-- your app's js -->
<script src="js/app.js"></script>
</head>
<body ng-app="famousguess" id="wrapper">
\t <ion-nav-bar class="bar-energized">
\t \t <ion-nav-back-button class="button-clear">
\t \t <i class="ion-arrow-left-c"></i> Back
\t \t </ion-nav-back-button>
\t </ion-nav-bar>
\t
\t <ion-nav-view></ion-nav-view>
\t
</body>
</html>
그리고 여기 내 템플릿 (보기/home.html을)
<ion-view view-title="welcome">
<ion-content scroll="false" class="box-energized">
<h1 id="logo">Famous Guess?</h1>
<a nav-transition="android" href="#/grid/1">
<button class="button button-block button-royal">
Start!
</button>
</a>
<button class="button icon-left button-block button-positive ion-social-facebook">
Connect to Facebook
</button>
</ion-content>
</ion-view>
감사를 간다!
감사합니다! 내가 다시 시작했기 때문에 이것이 문제인지 확실하지 않습니다. 문제는 오타였습니다. 아마도 당신이 지적한 것입니다. – IntegraStudio