Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.directive('photo', ['$http', 'modal', function($http, modal) {
- return {
- replace: true,
- templateUrl: '/assets/photo.html',
- transclude: false,
- scope: {
- result: '=',
- index: '@'
- },
- controller: ['$scope', '$http', 'modal', function($scope, $http, modal) {
- $scope.prev = $scope.index - 1;
- $scope.open = function() {
- debugger;
- };
- }]
- }
- }]);
- <div ng-repeat="r in results" photo result="r" index="$index"></div>
- controller: function($scope) {
- $scope.prev = $scope.index - 1;
- $scope.open = function() {
- debugger;
- };
- }
- $scope.open = function() {
- console.log($scope);
- debugger; //now you should see $scope.
- };
- app.directive('photo', ['$http', 'modal', function($http, modal) {
- return {
- replace: true,
- templateUrl: '/assets/photo.html',
- transclude: false,
- scope: {
- result: '=',
- index: '@'
- },
- controller: function($scope, $http, modal) {
- $scope.prev = $scope.index - 1;
- $scope.open = function() {
- debugger;
- };
- }
- }
- }]);
- var app = angular.module("moduleTest",[]);
- app.directive("testDirective",function(){
- return {
- restrict: "A",
- scope: true,
- link: function(scope, element){
- //code
- }
- }
- });
Add Comment
Please, Sign In to add comment