Skip to content
This repository was archived by the owner on Sep 15, 2024. It is now read-only.
This repository was archived by the owner on Sep 15, 2024. It is now read-only.

can't add ng-controller to div #111

Description

@RZsam

I'm using angularjs and angular ui router.
I want to use controller except default controller for this state
when I add ng-controller to div I have this error

angular.min.js:119 Error: [$injector:unpr] http://errors.angular.org/1.5.11/$injector/unpr?p0=myPicturesProvider%20%3C-%20myPictures%20%3C-%20MyPicturesController
    at /angular/angular.min.js:6:424
    at /angular/angular.min.js:43:219
    at Object.d [as get] (/angular/angular.min.js:41:1)
    at /angular/angular.min.js:43:281
    at d (/angular/angular.min.js:41:1)
    at e (/angular/angular.min.js:41:242)
    at Object.instantiate (/angular.min.js:42:77)
    at /angular/angular.min.js:91:374
    at Object.<anonymous> (/angular/router/angular-ui-router.min.js:11:15568)
    at/angular/angular.min.js:16:71 <ui-view class="ng-scope">How can I use ng-controller?

view:

<div id="single-post" class="modal" ng-controller="MyPicturesController">
<div class="modal-content fullHeight no-padding">

    <div class="row fullHeight">

        <div class="col m9 s12 fullHeight no-padding">
            <div class="picture-section fullHeight">
                <img class="picture" ng-src="[[PictureLink.original(current_picture)]]" alt="">
            </div>
        </div>
    </div>

   </div>
</div>

routes.js:

   .state('my', {
    templateUrl: 'panel/view/user_panel.layouts.my',
    controller: 'MyController'
})
   .state('my.journeys', {
        url: '/my/journeys',
        templateUrl: 'panel/view/user_panel.my.journeys',
        controller: 'MyJourneysController',
        resolve: {
            myJourneys: function (Request) {
                return Request.http('panel/my/journeys/table');
            }
        }
    })

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions