ui-router加载html但没有显示

时间:2015-10-29 12:48:20

标签: angularjs angular-ui-router angular-ui-bootstrap

我的job状态为:jobId

$stateProvider
    .state('employer', {
        url: "/",
        abstract: true,
        templateUrl: '../partials/employer/employerHome.html',
        controller: 'UserHomeController',
    })
    .state('employer.edit', {
        url: "^/edit",
        templateUrl: '../partials/employer/profile.html',
        controller: 'UserHomeController',
    })
    .state('employer.jobs', {
        url: "^/jobs",
        templateUrl: '../partials/employer/jobs.html',
        controller: 'formController'
    })
    .state('job', {
        parent: 'employer.jobs',
        url: '/job/:jobId',
        //  abstract: true,
        controller: 'formController',
        onEnter: ['$uibModal', '$state', '$http', '$stateParams', function ($uibModal, $state, $http, $stateParams) {
            console.log('Open modal');

            var modalInstance = $uibModal.open({

                templateUrl: 'myModalContent.html',
                backdrop: false,
                windowClass: 'right fade',
                keyboard: true,
                controller: 'PostModalInstanceCtrl',
                resolve: {
                    job: function () {
                        return $stateParams.jobId;
                    },

                },
            }).result.finally(function () {
                        $state.go('employer.jobs');
                        console.log('job modal closed')
                    });
        }],
    })
    .state('system_matches', {
        parent: 'job',
        url: "/system_matches",
        controller: 'TController',
        views: {
            'job@': {
                templateUrl: '../partials/employer/system_matches.html',
            }
        }
    });

当我转到system_matches状态时,网址看起来不错:/employer#/jobs/job/1/system_matches并且HTML正在控制台中加载,但无法看到该视图。

job/:jobId状态是一个模态,从那里我想去 system matches状态不在模态中。

我想我需要添加一个ui-view div。我的问题是我需要将div置于何处以及如何使用id参数命名?

0 个答案:

没有答案