title: Migrating a JavaScript\Ionic\Angular 1 App to Typescript\Ionic 2\Angular 2 App
body: <p>I'm working on migrating an App from JavaScript\Ionic\Angular1 to Typescript\Ionic2\Angular2 one file at a time. I've poured over dozens of how-to's and such about migrating from one to the other, done the Angular 2 quick start and tutorial, and seen how to go from .js to .ts as well as installed all of the npm packages I need. Assuming I have everything I need to start the migration process, I really need help actually starting. I have dozens of files to convert, and it would help me greatly to just get one file converted correctly with the old code commented out to use as a reference to convert the others. </p>
  
  <p>Here is a sample file. If you could convert this for me, or walk me through converting it, I would be very appreciative. </p>
  
  <pre><code>angular.module('myApp.app', ['ionic'])
      .controller('myApp.app', function($rootScope, $scope, AService, BService, CService){
          $scope.setUserName = function (user){
              $scope.user = user;
          };
          document.addEventListener('deviceready', function() {
              $rootScope.$on('$cordovaNetwork:online', function (e, nState) {
                  BService.setOnline(true);
              })
          })
      })
  </code></pre>
  
  <p>Thank you.</p>