Angularjs 我的代码中有什么错误没有解决用户详细信息?

Angularjs 我的代码中有什么错误没有解决用户详细信息?,angularjs,express,angular-ui-router,Angularjs,Express,Angular Ui Router,您好,我是express和angular的新手,我正在尝试为用户提供CRUD功能。 这是我的UserAjax.js文件,我在其中定义了get请求 var router = require('express').Router() , mongoose = require('mongoose') , _ = require('underscore') , Q = require('q'); module.exports = function() { var User = m

您好,我是express和angular的新手,我正在尝试为用户提供CRUD功能。 这是我的UserAjax.js文件,我在其中定义了get请求

var router = require('express').Router()
    , mongoose = require('mongoose')
    , _ = require('underscore')
    , Q = require('q');

module.exports = function() {
var User = mongoose.model('users');

return router


    .param('/:users', function(req, res, next) {
        var userId = req.params.user;

        Q
            .nbind(User.findById, User)(userId)

            .then(function(doc) {
                res.json(doc);
            })

            .catch(function(err){
                next(err);
            })
    })

    .get('/', function(req, res, next) {
        var Query = User.find();
        var qry = req.query;

        Q
            .nbind(Query.exec, Query)()

            .then(function(docs){
                res.json(docs);
            })

            .catch(function(err){
                next(err);
            });

    })

    .get('/:users', function(req, res, next) {
        var userId = req.params.user;
        var Query = user.findById(userId);

        Q
            .nbind(Query.exec, Query)()

            .then(function(doc) {
                res.json(doc);
            })

            .then(null, function(err) {
                next(err);
            })
    })

    .post('/', function(req, res, next){
        var data = req.body;
        data.createdBy = req.user._id;

        Q
            .nbind(User.create, User)(data)

            .then(function(doc){
                res.json(doc);
            })

            .catch(function(err){
                next(err);
            });
    })

    .put('/:users', function(req, res, next){
        var userId = req.params.user;
        var data = req.body;

        data.lastUpdatedBy = req.user._id;

        Q
            .nbind(User.findById, User)(userId)

            .then(function(doc){
                return Q.nbind(doc.modify, doc)(data);
            })

            .spread(function(doc, numAffected){
                res.json(doc);
            })

            .catch(function(err){
                next(err);
            });
    })


    .delete('/:users', function(req, res, next){
        var userId = req.params.user;

        Q
            .nbind(User.findByIdAndUpdate, User)(userId, {
                $set : {lastUpdatedBy : req.user._id, lastUpdatedOn : Date.now()}
            })

            .then(function(doc){
                return Q.nbind(doc.remove, doc)();
            })

            .then(function(doc){
                res.json(doc);
            })

            .catch(function(err){
                next(err);
            });
    })
    ;
}
这是我的用户状态提供程序文件,我在其中解析了用户详细信息

'use strict';

(function() {


angular
    .module('nrmcApp.user', [])


    .config([
        "$stateProvider"
        , function($stateProvider) {
            $stateProvider
                .state('user', {
                    abstract : true
                    , url : "/users"
                    , templateUrl : '/partials/users/index'
                    , controller : [
                        "$scope"
                        , "$state"
                        , function($scope, $state) {
                            $scope.title = "Users";

                            $scope.setSelected = function(item) {
                                $scope.selected = item;
                            }
                        }
                    ]
                })

                .state('user.list', {
                    url : ''
                    , templateUrl : '/partials/users/list'
                    , controller : [
                        "$scope"
                        , "$state"
                        , "users"
                        , function($scope, $state, users) {
                            $scope.title = "Users";

                            $scope.users = users || [];

                            $scope.setSelected = function(item) {
                                $scope.selected = item;
                            }

                            $scope.changeState = function() {
                                $state.go('user.new');
                            }

                            $scope.changeState = function() {
                                $state.go('user.edit');
                            }

                            $scope.changeState = function() {
                                $state.go('user.detail');
                            }


                        }
                    ]
                    , resolve : {
                        "users" : ["User", function(User) {
                            return User.query().$promise
                        }]
                    }
                })

                .state('user.new', {
                    url : ''
                    , templateUrl : '/partials/users/new'
                    , controller : [
                        "$scope"
                        , function($scope) {
                            $scope.title = "Enter User Details";
                        }
                    ]
                })

                .state('user.edit', {
                    url :'/edit/:userId'
                    , templateUrl : '/partials/users/edit'
                    , controller : [
                        "$scope"
                        , "users"
                        , function($scope, users) {
                            $scope.title = "Edit Users Detail"

                            $scope.users = users;
                        }
                    ]

                    , resolve :  {
                        "users" : ["User", function(User, $stateParams) {
                            return User.get({ id : $stateParams.user }).$promise;
                        }]
                    }
                })
问题是,当我点击链接编辑,然后它显示404未找到。 正如我提到的,get请求没有得到它。 我完全卡住了,谁能帮我一下吗。
提前感谢。

在开发人员工具中的“网络”选项卡中进行检查。在尝试获取模板文件时,或者每当您为CRUD操作发出get请求时,您的一个get请求可能会失败。我检查了它,但无法获取http://localhost:2424/edit/users 那么,我的get请求有什么问题..找不到编辑/用户