Hi Sander, 

I'm working on the directives, which is progressing quite alright I must 
say, but I'm having difficulty with the following:

I made a directive attribute from my carousel, and use the following code:

IFE.directive('carousel', function() {
   return {
       restrict: 'A',
       link: function(scope, element, attr){
           
           scope.$watch('selectedLanguageFunction', function(){
               //alert('veranderd!');
               element.scooch('reset');
           })
           
       }
   };
}); 

So what I want to accomplish, is that the carousel re-initializes itself, 
once the filter value has changed. 
(btw. Using the alert function demonstrated that the function is triggered 
at the right time).

But I get the following error in my console.log:

TypeError: undefined is not a function
    at Object.fn (http://127.0.0.1/v4/js/angular.js:102:25)
    at k.$digest 
(http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular.min.js:109:172)
    at k.$apply 
(http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular.min.js:112:173)
    at 
http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular.min.js:18:239
    at Object.d [as invoke] 
(http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular.min.js:35:36)
    at c 
(http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular.min.js:18:147)
    at cc 
(http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular.min.js:18:356)
    at Xc 
(http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular.min.js:17:445)
    at 
http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular.min.js:212:356
    at HTMLDocument.a 
(http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular.min.js:144:145)
 

Strange thing is that before I changed to a directive, the jQuery function:

    $(".languagedropdown li a").click(function(){

      //$('.m-scooch').scooch('reset');

    });

did work.

Can you help me out on this one?



Op vrijdag 26 september 2014 15:51:01 UTC+2 schreef Jan Willem Hennink:
>
> Nice!! really looking forward to it!
>
> 2014-09-26 15:48 GMT+02:00 Sander Elias <[email protected]>:
>
>> Hi Jan Willem,
>>
>> Yes, you are right, it will start at 18:00. Food is included. We will 
>> have a introduction and a workshop with
>> angular 2.0. We have talked the stuff trough, and it will be very 
>> informative/awesome ;)
>>
>> Besides the official agenda, there will be room for networking and 
>> socializing. 
>>
>> 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/uMiDC8FD8rA/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.
>>
>
>
>
> -- 
> JW Hennink
> Madurastraat 47-I
> 1094GE Amsterdam
> 06 230 66 490
>  

-- 
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.

Reply via email to