jquery - How to use turn.js in Ionic 2? -


i have ionic v1 project using turn.js i'm using ionic v2. i'm having problem import turn.js using jquery.

angular.module('albumcontroller', [])  .directive('flipbook', function () { return {     restrict: 'e',     replace: true,     compile: function (element, attrs) {         element.turn({             width: '300px',             height: '300px',             pages: 8         }).turn('peel', 'br');          element.addclass('flipbook');         return function (scope, el) {             el.on('click', '[data-page]', function (e) {                 el.turn('page', $(e.target).data('page'));             });          };     },     templateurl: "flipbook.html" } }); 

thanks!

i don't know if have answer. me following:

  1. install jquery ionic(check here)
  2. npm install --save turn.js

  3. import $ "jquery"; import "turn.js";

just can use $().turn();

hope :d


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -