Advertisement
Guest User

asd

a guest
Sep 9th, 2015
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. /*
  2. * We are initializing knockout and addtional extensions that
  3. * we are going to use in this project.
  4. */
  5. import ko = require( 'knockout' );
  6. import koPunches = require( 'knockout.punches' );
  7.  
  8. // not sure what was the reason, but ts actually cuts out
  9. // import statements that are not used anywhere
  10. // so we will workaround this by "using" them in fake way
  11. var fakeArray = [ ko , koPunches ];
  12.  
  13. //
  14. // those two are not coming with node.js module (attr binder) or
  15. // their node.js implementation is broken for browserify (knockout.es5)
  16. // so we are going to use var=require instead to bypass typescript typechecker
  17. var koAttributeBinder: any = require( './vendor/knockout-attribute-binder' );
  18. var koES5: any = require( './vendor/knockout.es5' );
  19.  
  20. // we are setting attribute binder syntax to ko-binding, ex. ko-click, ko-value, ko-foreach
  21. koAttributeBinder.setPrefix( 'ko' );
  22. koAttributeBinder.install( true );
  23.  
  24. // finally we are going to enable knockout punches
  25. ko.punches.enableAll();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement