0

I am trying to use the angular bootstrap module. i am getting this error

Error: $injector:unpr Unknown Provider

when i add the ui.bootstrap.

I have looked at lot of examples but i am not able to figure it out.

Thanks

This is my Factory

(function () {
'use strict';
var app = angular.module('Candidate', ['ui.bootstrap']);
var serviceId = 'conferenceFactory';

app.factory(serviceId, ['$http', conferenceFactory]);

function conferenceFactory($http) {

    var service = {
        getCandidate: getCandidate,
    };

    return service;


    function getCandidate() {
        return $http.get('/api/getcandidate/get');
    }
}
})();

This is my Controller Code

(function () {
'use strict';

var controllerId = 'conferenceController';
 angular.module('Candidate', ['ui.bootstrap']).controller(controllerId,
    ['$scope', 'conferenceFactory', '$modalInstance',
function ($scope, conferenceFactory, $modalInstance) {

getdata();

function getdata() {

    $scope.candidates = [];
    conferenceFactory.getCandidate().success(function (data) {
        $scope.candidates = data;
    }).error(function (data) {

    });
}

    $scope.showCandidate = function (data) {
        var params = {
            candidate: data,
        };
    };
}
]);

 })();
1
  • 1
    Did you remember to add the link to the angularbootstrap js file in your index.html file? Commented May 4, 2015 at 23:41

1 Answer 1

1

You need to make sure you have added in the links to angular bootstrap files in your index.html . e.g.

 <script src="bower_components/angular-bootstrap/ui-bootstrap.js"></script>
 <script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script>
Sign up to request clarification or add additional context in comments.

1 Comment

Yes i already did. I think there is something wrong in the my angular code that i cannot figure out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.