Hi sender thanks for you view but it won't work ,
i am sending my entire code please make ti correct.
<html>
<head>
<style>
.operationalArea {
background-color: #eeeeee;
height: 100px;
width: 100px;
float: left;
padding: 5px;
}
</style>
</head>
<body>
<script src="
http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js
"></script>
<script>
var webQueryApp = angular.module("webQueryApp", [ ]);
webQueryApp.directive('myDraggable', function(){
return{
scope: {
'arr':'=',
},
//link start
link: function ($scope, element, attrs) {
attrs.$observe('arr',function(){
console.log($scope.arr);
});
element.bind('click', function(event) {
console.log("element clicked and arr is "+attrs.arr);
});
}
//link end
};
});
webQueryApp.controller('TestAppController', function($scope, $http) {
var app = this;
console.log("hello console");
$scope.arr=[1,2,3,4];
});
</script>
<div ng-app="webQueryApp">
<div ng-controller="TestAppController">
<div class="operationalArea" my-Draggable data='arr' > click me
</div>
</div>
</div>
</body>
</html>
[image: Inline image 1]
On Fri, Oct 9, 2015 at 7:35 PM, Sander Elias <[email protected]> wrote:
> Hi Ajay,
>
> By making it a property on your element in the view, and put in in your
> isolate scope.
>
> view:
> <my-Dragable data='arr'></my-Dragable>
>
> directive:
> function myDragable() {
> return {
> restruct:'E',
> scope: {
> 'arr': '='
> },
> link: linkFn
> }
>
> function linkFn(scope, elm, attrs) {
> attrs.$observe('arr', function () {
> console.log(scope.arr);
> })
> }
>
>
> Regards
> Sander
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "AngularJS" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/angular/uiN9XlVQrMc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
>
--
Thanks and regards,
Ajay
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.