Ui.Router loads/imports JS files, but buttons lose functionality

Asked

Viewed 49 times

1

The template Smartadmin uses lazyScript to import the JS files, it works, it matters all right, but when I navigate between the pages the Ui buttons, stop working.

angular.module('app.analytics', ['ui.router'])
        .config(function($stateProvider, $urlRouterProvider) {

          $stateProvider
             .state('app.equipmentManagement', {
            url: '/gestao-de-equipamento',
            views: {
                "content@app": {
                    templateUrl: 'app/views/equipmentManagementAnalytics.html'
                }
            },
            data:{
                title: 'Analytics'
            },
            resolve: {
                scripts: function(lazyScript){
                    return lazyScript.register([
                        'build/vendor.graphs.js',
                        'build/vendor.ui.js'
                    ]);
                }
            }
        })
        .state('app.correlationAnalytics', {
            url: '/correlacao',
            views: {
                "content@app": {
                    templateUrl: 'app/views/correlationAnalytics.html'
                }
            },
            data:{
                title: 'Analytics'
            },
            resolve: {
                scripts: function(lazyScript){
                    return lazyScript.register([
                        'build/vendor.graphs.js',
                        'build/vendor.ui.js'
                    ]);
                }
            }
        })
        .state('app.eventFrame', {
            url: '/event-manager',
            views: {
                "content@app": {
                    templateUrl: 'app/views/eventManager.html'
                }
            },
            data:{
                title: 'Event Manager'
            },
            resolve: {
                scripts: function(lazyScript){
                    return lazyScript.register([
                        'build/vendor.graphs.js',
                        'build/vendor.ui.js'
                    ]);
                }
            }
        })
});

1 answer

0

The template does not recognize the widgets, because the directive data-widget-grid cannot contain itself in another div.

I resolved only by removing the directive data-widget-grid of children.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.