1

In order to avoid to rewrite all code when replacing angular with other framework, i wonder if there any solution to de-couple angularJS and JS? if yes, how to test them( because cant't use angular testing module anymore )?

bificoo
  • 11
  • 1
  • 1
    Please add more detail about it. Because as of now it seems, there is no problem at all. Because angular has its own scope of veriables in $scope and $rootScope which should not conflict with regular js code. – binariedMe Jul 09 '15 at 05:45

1 Answers1

0
  1. Use services By having your code contained in services, you can easily move them around and adapt them to suit other frameworks

  2. Having local functions Usually, you create functions that interact with the view in the scope. You could however, have them in local functions which are called by the scope functions. That way, when you change the framework, you can move retain the local functions.

These are the two things that come to mind but I am sure there are more.

callmekatootie
  • 10,989
  • 15
  • 69
  • 104