Skip to content Skip to sidebar Skip to footer

Angularjs Update Service Variable Not Working

I have a list of images. One next to the other. I'm trying to capture which image was clicked, populate a modal div and show it. Markup

Solution 2:

You didn't insert dependecy injection ModalService in PortfolioCtrl controller

app.controller("PortfolioCtrl", function($scope, $rootScope, PortfolioService,ModalService ){
    $scope.portfolios = PortfolioService.list();
    $scope.showModal = function(index){
        ModalService.setInfo($scope.portfolios[index]);
    }

});

Post a Comment for "Angularjs Update Service Variable Not Working"