Skip to content

Conversation

@julianosam
Copy link

@julianosam julianosam commented Oct 31, 2016

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.

@codecov-io
Copy link

Current coverage is 95.65% (diff: 100%)

Merging #37 into master will increase coverage by 1.53%

@@             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

3 similar comments
@codecov-io
Copy link

Current coverage is 95.65% (diff: 100%)

Merging #37 into master will increase coverage by 1.53%

@@             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

@codecov-io
Copy link

Current coverage is 95.65% (diff: 100%)

Merging #37 into master will increase coverage by 1.53%

@@             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

@codecov-io
Copy link

codecov-io commented Oct 31, 2016

Current coverage is 95.65% (diff: 100%)

Merging #37 into master will increase coverage by 1.53%

@@             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

@TheLarkInn
Copy link
Owner

Would you merge conflicts sorry I'm just getting to this. 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants