Question: Printer type **hp officejet pro 6830**  

Is there a way to scan from html/java script image from a scanner ?  

If it cant be done can anyone recommend a **lib** for java that give access to the printer/scanner.

The over all idea is to add a **button** to web page and scan image back to the page or to a local folder 

I already tried using **Scanner.js**: HTML/JavaScript Web Twain WIA 

but it didnt work for me not sure why?

thanks

Answer: 
I found a quite cheap solution for the issue.

Just use `template: require('./remote-url.component.html')` instead of `templateUrl: './remote-url.component.html'` and it should work just fine!
Most of the answers given here involve pre-loading the template in some way so as to make it available synchronously to the directive.

If you want to avoid doing this - e.g. if you have a large AngularJS application that contains many templates, and you don't want to download them all up front - you can simply wrap your directive in a synchronously loaded version instead.

E.g., if you have a directive called `myDirective`, which has an asynchronously loaded `templateUrl` which you don't want to download up front, you can do this instead:

```
angular
  .module('my-module')
  .directive('myDirectiveWrapper', function() {
    return {
      restrict: 'E',
      template: "<my-directive></my-directive>",
    }
  });

```

Then your Upgraded Angular directive just needs to supply `'myDirectiveWrapper'` instead of `'myDirective'` in it's `super()` call to the extended `UpgradeComponent`.