Angularjs 空载下的ng路线,页面正确
我有一个子网站,这个没有头,身体等,只包含内容和im调用与ng路由和显示与ng视图,但如果我调用没有路由eq.localhost/secondtab.html的网站,所有工作正常,但如果我调用与路由和ngview,脚本不工作在这里我把代码Angularjs 空载下的ng路线,页面正确,angularjs,Angularjs,我有一个子网站,这个没有头,身体等,只包含内容和im调用与ng路由和显示与ng视图,但如果我调用没有路由eq.localhost/secondtab.html的网站,所有工作正常,但如果我调用与路由和ngview,脚本不工作在这里我把代码 var myApp = angular.module("myApp",['ngRoute']); $url ="/load.php?stundent=<? echo $_GET["all"]; ?>";
var myApp = angular.module("myApp",['ngRoute']);
$url ="/load.php?stundent=<? echo $_GET["all"]; ?>";
myApp.factory('myService',function($http){
var getData = function() {
return $http({method:"GET", url:$url}).then(function(result){
return result.data;
});
};
return { getData: getData };
});
myApp.config(function($routeProvider) {
$routeProvider
.when('/', {
templateUrl : 'main.html',
controller : 'ItemsController'
})
// route for the home page
.when('/one', {
templateUrl : 'one.html',
controller : 'ItemsController'
})
// route for the about page
.when('/two', {
templateUrl : 'p/two.html',
controller : 'othercontroller'
});
});
myApp.controller('othercontroller', function othercontroller($scope,$http) {
...
});
myApp.controller('ItemsController', function ItemsController($scope,myService,$timeout,$http) {
...
}
提取main.html
<!DOCTYPE html>
<html ng-app="myApp">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title></title>
<head>
//load css
//load script(angularjs, routejs, jquery)
</head>
<body>
<a href="#one" target="_self" class="ng-binding">one</a>
<a href="#two" target="_self" class="ng-binding">two</a>
</body>
这个失败了
<script type="text/javascript">
if(typeof Muse == "undefined") window.Muse = {}; window.Muse.assets = {"required":["jquery-1.8.3.min.js", "museutils.js", "webpro.js", "musewpslideshow.js", "jquery.museoverlay.js", "touchswipe.js", "jquery.musepolyfill.bgsize.js", "jquery.watch.js", "musewpdisclosure.js", "jquery.musemenu.js", "index.css"], "outOfDate":[]};
</script>
<!-- CSS -->
.....
<!-- Other scripts -->
<script type="text/javascript">
document.documentElement.className += ' js';
</script>
<!-- JS includes -->
<!--[if lt IE 9]>
<script src="scripts/html5shiv.js?4241844378" type="text/javascript"></script>
<![endif]-->
//content
.......
here a accordion menu
//content
<script type="text/javascript">
if (document.location.protocol != 'https:') document.write('\x3Cscript src="http://musecdn2.businesscatalyst.com/scripts/4.0/jquery-1.8.3.min.js" type="text/javascript">\x3C/script>');
</script>
<script type="text/javascript">
window.jQuery || document.write('\x3Cscript src="p/scripts/jquery-1.8.3.min.js" type="text/javascript">\x3C/script>');
</script>
请帮帮我