Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'scope' of undefined #8

Open
danidev opened this issue Apr 7, 2016 · 2 comments
Open

Cannot read property 'scope' of undefined #8

danidev opened this issue Apr 7, 2016 · 2 comments

Comments

@danidev
Copy link

danidev commented Apr 7, 2016

Hello,

I've just installed angular.panels by bower and configured as in the tutorial.

when I call panels.open('left-menu') I get this error:

TypeError: Cannot read property 'scope' of undefined
    at Object.s.open (angular.panels.min.js:formatted:21)

here is my config:

.config(['panelsProvider', function (panelsProvider) {
    panelsProvider
        .add({
            id: 'left-menu',
            position: 'left',
            size: '700px',
            templateUrl: 'components/leftmenu/leftmenu.html',
            controller: 'LeftMenuCtrl'
        });
  }

and this is my controller:

(function() {
    'use strict';
    function LeftMenuCtrl($scope) {
        var self = this;
        self.init = function() {
            console.log('left panel');
        };
        self.init();
    }

    angular.module('myapp')
        .controller('LeftMenuCtrl', ['$scope', LeftMenuCtrl]);
})();

Any ideas?

thanks in advance,
Daniele

@Sharique-Hasan
Copy link

@eu81273 I am also facing the same issue.

@Sharique-Hasan
Copy link

@danidev I got it working. You need to put this div in your html too:

<div data-panels="true"></div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants