大神 救救救救救我!
angularjs吧
全部回复
仅看楼主
level 1
奥丁海兹 楼主
我做一个页面跳转过不去。
路由:mainApp.js
var App = angular.module('App',['ngRoute','ngResource','ngSanitize']);
App.config(['$routeProvider',function($routeProvider){
$routeProvider.when('/',{
templateUrl:'add.html',
controller:'HomeCtrl'
}).when('/1',{
templateUrl:'list.html',
controller:'list'
}).otherwise({
redirectTo:'/'
});
}]);
配置器:AddController。js
App.controller('HomeCtrl',['$scope', '$location', '$timeout', '$route', function ($scope, $location, $timeout, $route)
$scope.button1 = function(){
$location.path('/1');
}]);
App.controller('list',['$scope', '$location', '$timeout', '$route', function ($scope, $location, $timeout, $route)
$scope.button2 = function(){
$location.path('/1');
}]);
主页:newhtml
<html class="no-js">
<head>
<meta charset="utf-8">
</head>
<body ng-app="App" class="metro" onorientationchange="updateOrientation();"
<div ng-view=""></div
<script src="angular/angular.min.js"></script>
<script src="angular/angular-resource.min.js"></script>
<script src="angular/angular-route.min.js"></script>
<script src="angular/angular-sanitize.min.js"></script>
<script src="mainApp.js"></script>
<script src="AddController.js"></script>
2015年11月04日 02点11分 1
level 1
奥丁海兹 楼主
add:<input type="button" value="跳转" ng-click="button1()">
list:<input type="button" value="跳转1" ng-click="button2()">
两个页面互相能跳转,我光能显示但摁按钮没有反映
2015年11月04日 02点11分 2
level 1
奥丁海兹 楼主
111
2015年11月04日 06点11分 3
1