Convert (function(){ angular.module('starter').factory(...) to Creator version


#1

Spent a long time trying to add a PDF View feature to my app. All attempts failed so far.

I know a working app for showing PDF in Ionic. But the problem is, everywhere in that app, the format used for js files is something that can’t directly be used in Creator. For example the single controller in the app called document.controller.js has following format:

   (function () {
       angular.module('starter').controller('DocumentController', ['$scope', '$ionicModal', 'InvoiceService', DocumentController]);

    function DocumentController($scope, $ionicModal, InvoiceService) {
          var vm = this;
          .....
    }
   )();

Because Creator only allows entering the code after “function” in the .controller, I don’t know how to get the above style into a style acceptable by Creator.

Anyone can help with good suggestion?

(the document mentioned above and the PDF app can be found here: https://github.com/ashteya/ionic-tutorial-pdf/blob/master/www/js/document.controller.js)