ui-router.stateHelper icon indicating copy to clipboard operation
ui-router.stateHelper copied to clipboard

Uncaught Error

Open rosostolato opened this issue 7 years ago • 4 comments

this is my code:

stateHelperProvider

        .state({
            name: 'assets',
            url: '/assets',
            templateUrl: 'app/assets/assets.html',
            children: [
                {
                    name: 'monitoring',
                    url: '/monitoring',
                    templateUrl: 'app/assets/assetsMonitoring/assetsMonitoring.html',
                    controller: 'assetsMonitoringCtrl',
                    controllerAs: 'vm'
                },
                {
                    name: 'report',
                    url: '/report?{view:string}',
                    templateUrl: 'app/assets/assetsReport/assetsReport.html',
                    controller: 'assetsReportCtrl',
                    controllerAs: 'vm',
                    params: { view: { dynamic: true } }
                },
                {
                    name: 'manager',
                    url: '/manager',
                    templateUrl: 'app/assets/assetsManager/assetsManager.html',
                    controller: 'assetsManagerCtrl',
                    controllerAs: 'vm'
                }
            ]
        });

and this is what angular says:

Failed to instantiate module app due to: Error: States that specify the 'parent:' property should not have a '.' in their name (assets.monitoring)

I resolved the problem using { keepOriginalNames: true }, but I have to use "manager" instead of "assets.manager" in ui-sref tag and it's causing me problems with other states that has the same child name, which is the case of "manager" state.

What do I do?

rosostolato avatar Jan 18 '18 19:01 rosostolato

Did you solve this?

stereokai avatar Jan 31 '18 14:01 stereokai

No, I gave up and stopped using it

rosostolato avatar Feb 01 '18 16:02 rosostolato

I have found what the problem is.

In this block (line 43), add delete state.parent;

            if (!options.keepOriginalNames) {
                fixStateName(state);
                delete state.parent;
            }

stereokai avatar Feb 01 '18 17:02 stereokai

@davidzwa Well, that's up to @marklagendijk, the repo owner :)

stereokai avatar Apr 30 '18 11:04 stereokai