directives not working with turn.js(javascript library)

503 views
Skip to first unread message

Bhuwan Arora

unread,
Mar 21, 2014, 1:29:31 AM3/21/14
to ang...@googlegroups.com

I have created a directive that creates a flipbook using turn.js(which needs jquery). But none of the angular-directive(ng-click, ng-mouseover etc) works inside the flipbook html which is although getting rendered properly. Even the jquery bindings for click, mouseover etc are not working..

What is happening?

How to debug this problem?

Bhuwan Arora

unread,
Mar 21, 2014, 2:05:30 AM3/21/14
to ang...@googlegroups.com
<div ng-app="test">
    <flipbook></flipbook>
</div>

inside flipbook directive

controller: function($scope){   $scope.onClick = function(){
     console.log("click not working");   })

  $('#randomID').turn(options); })

flipbook template

<div ng-click="onClick()"> </div>

Bhuwan Arora

unread,
Mar 21, 2014, 2:48:42 AM3/21/14
to ang...@googlegroups.com
Even putting  $('#randomID').turn(options); }) in $scope.$apply does no good.


On Friday, 21 March 2014 10:59:31 UTC+5:30, Bhuwan Arora wrote:

Gaurav Sharma

unread,
Mar 21, 2014, 2:59:53 AM3/21/14
to ang...@googlegroups.com
can you create a plnkr?


--
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 angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.



--
Thanks and Regards,
Gaurav Sharma

Bhuwan Arora

unread,
Mar 21, 2014, 4:02:40 AM3/21/14
to ang...@googlegroups.com

Though I am unable to add $apply here(the nested digest error)


On Friday, 21 March 2014 10:59:31 UTC+5:30, Bhuwan Arora wrote:

Bhuwan Arora

unread,
Mar 21, 2014, 4:50:40 AM3/21/14
to ang...@googlegroups.com
The problem is solved. I shifted the code from controller to the link function in directive and everything started to work..though I wonder why?


On Friday, 21 March 2014 10:59:31 UTC+5:30, Bhuwan Arora wrote:

Gaurav Sharma

unread,
Mar 21, 2014, 5:30:19 AM3/21/14
to ang...@googlegroups.com
Directives uses link function to modify the DOM.


--
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 angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

chandra kant Paliwal

unread,
Oct 13, 2017, 8:14:48 AM10/13/17
to Angular and AngularJS discussion
can you please update plunkr, i am also trying same but not working for me and i want to use ng-repeat with in template so
Reply all
Reply to author
Forward
0 new messages