0

I would like to be able to do the following in my controller (Note* I'm using TypeScript):

disclosure.disclosureDocument = $scope.document;

where disclosure is my model. However, this doesn't work as explained here.

My question is there a simple way to bind my input[type=file] to $scope so that I may assign it to my model and pass it through Nancy and to my back-end? If more information is needed, please let me know.

The Vanilla Thrilla
  • 1,915
  • 10
  • 30
  • 49
  • Did you have read: http://stackoverflow.com/questions/25472254/angular-ie9-fileupload-is-not-working ? – mico Mar 18 '15 at 20:26

1 Answers1

0

neat way of dealing with models is not to assign everything in scope rather assign a instance of controller to scope variable and use in view

class fooController  {

   public fooModel;
   static $inject = ['$scope'];
   constructor(scope){

   this.fooModel ='hello world'
   //assign instance to a scope variable and access in view
   scope.vm=this
  }
}

and in view

  <div>{{vm.fooModel}}</div>
Pranay Dutta
  • 2,483
  • 2
  • 30
  • 42