Adding type assertion <string> option to fix issues with typescript type checks
Typescript complains about the return type of the require() function once A2 defines the component template field as type string. The correct A2 component annotation should be as follows:
@Component({
selector: 'my-component',
template: <string> require('./my-template.html'),
styles: [<string> require('./my-style.css')]
})
This adds an option to include typeAssertion to the require() generation. It supports both passing it as a query param angular2-template-loader?typeAssertion=true or the via options plugin supported by Webpack 2. Right now, it leaves the type assertion inclusion defaulted to false. But I think it should be defaulted to true in a near future.
Current coverage is 95.65% (diff: 100%)
@@ master #37 diff @@
==========================================
Files 1 1
Lines 17 23 +6
Methods 5 5
Messages 0 0
Branches 3 6 +3
==========================================
+ Hits 16 22 +6
Misses 1 1
Partials 0 0
Powered by Codecov. Last update c411e90...866918e
Current coverage is 95.65% (diff: 100%)
@@ master #37 diff @@
==========================================
Files 1 1
Lines 17 23 +6
Methods 5 5
Messages 0 0
Branches 3 6 +3
==========================================
+ Hits 16 22 +6
Misses 1 1
Partials 0 0
Powered by Codecov. Last update c411e90...866918e
Current coverage is 95.65% (diff: 100%)
@@ master #37 diff @@
==========================================
Files 1 1
Lines 17 23 +6
Methods 5 5
Messages 0 0
Branches 3 6 +3
==========================================
+ Hits 16 22 +6
Misses 1 1
Partials 0 0
Powered by Codecov. Last update c411e90...866918e
Current coverage is 95.65% (diff: 100%)
@@ master #37 diff @@
==========================================
Files 1 1
Lines 17 23 +6
Methods 5 5
Messages 0 0
Branches 3 6 +3
==========================================
+ Hits 16 22 +6
Misses 1 1
Partials 0 0
Powered by Codecov. Last update c411e90...866918e
Would you merge conflicts sorry I'm just getting to this. 😅