Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用ng view时浏览器后退按钮未加载正确的内容(前端为angular js;后端为node+;express)_Javascript_Jquery_Html_Angularjs_Node.js - Fatal编程技术网

Javascript 使用ng view时浏览器后退按钮未加载正确的内容(前端为angular js;后端为node+;express)

Javascript 使用ng view时浏览器后退按钮未加载正确的内容(前端为angular js;后端为node+;express),javascript,jquery,html,angularjs,node.js,Javascript,Jquery,Html,Angularjs,Node.js,最初,当我使用/home.html时,我可以看到home.html成功地进入index.html,然后单击此处的任何帮助。。。或者,如果需要更多的解释问题,我可以帮助即使两周后没有帮助,我搜索了很多但无法找出:(这里有任何帮助…或者如果需要更多的解释问题,我可以帮助即使两周后没有帮助,我搜索了很多但无法找出:( angular.module('appRoutes', []).config(['$routeProvider', function($routeProvider) {

最初,当我使用/home.html时,我可以看到home.html成功地进入index.html,然后单击
此处的任何帮助。。。或者,如果需要更多的解释问题,我可以帮助即使两周后没有帮助,我搜索了很多但无法找出:(这里有任何帮助…或者如果需要更多的解释问题,我可以帮助即使两周后没有帮助,我搜索了很多但无法找出:(
    angular.module('appRoutes', []).config(['$routeProvider',  function($routeProvider) {
        $routeProvider

            // home page
            .when('/', {
                templateUrl: 'views/home.html',
                controller: 'MainController'
            })

            // nerds page that will use the NerdController
            .when('/club', {
                templateUrl: 'views/club.html',
                controller: 'ClubController'
            }); 

    }]);
    angular.module('ClubCtrl', []).controller('ClubController', [ '$http','Club', function($http, Club) {
        var club = this;
        club.data = {};
        Club.getClubData().then(function(response){
            club.data = response.data;
        });
    }]);
    angular.module('ClubService', []).factory('Club', ['$http', function($http) {

        return {
            getClubData : function() {
                return $http.get('/api/club');
            }
          };
    }]);
    module.exports = function(app) {
        app.get('/', function(req, res) {
                console.log("routes send get(*)");
                res.sendFile(path.resolve('public/index.html')); // load our public/index.html file
            });
        app.get('/api/club', function(req, res){
            console.log("routes send get /club");
        con.query("select * from club_data", function(err, rows,field) {
        if (!err)
        {
            console.log('The solution is: ', rows);
            res.json(rows);
        }
        else
            console.log('Error while performing Query. ', err);
            });
        });

    };
        </div>
              <div class="row " >
                <div class="col-md-3 col-sm-6 image-feature" ng-repeat='dat in main.data'>
                    <div class="thumbnail">
                        <img ng-src="images/club/{{dat.imagename}}"alt="">
                        <div class="caption">
                            <h3>{{ dat.name }}</h3>
                            <p>{{dat.desccription}}</p>
                            <p>{{dat.date}}</p>
                            <p>
                                <a href="#" class="btn btn-primary">I'm Going!</a>
                            </p>
                        </div>
                    </div>
                </div>
  <h1>Party</h1>
                    <div class="divider"></div>
                    <p>"Anytime I'm at a club or a party, I'm dancing from beginning to end."<br>--Agnes Bruckner</p>
                </div>

                <div class="row">
                    <div class="col-md-3 col-sm-3 col-xs-6">
                        <div class="about-item scrollpoint sp-effect2">
                            <a href="#/club" style="text-decoration:none"></a>
    <body ng-app="staygala" ng-controller="MainController">

        <!-- ANGULAR DYNAMIC CONTENT -->
        <div ng-view></div>
    </body>
        angular.module('staygala', ['ngRoute', 'appRoutes', 'MainCtrl', 'ClubCtrl', 'ClubService']);