setting up plnkr for angularjs pagination not working

43 views Asked by At

I am new to using plnkr. I have created my first plnkr and facing an issue in setting the $scope.currentPage variable. All other variables are working fine except the currentPage. I am using the angular-utils-pagination directive. Once I click on the page number the variable is getting printed but when the page gets loaded for the first time the variable is not initialized. Please let me know where I am going wrong. The link for the plnkr - Link

1

There are 1 answers

1
jbrown On BEST ANSWER

The problem is that you are injecting $scope into your MyApp directive. There's no need to do this since directives have access to their parent scope by default. So it should look like this:

angular.module('myApp').directive('myTable', function ()