angular-jsx icon indicating copy to clipboard operation
angular-jsx copied to clipboard

Handle all JSX on page

Open eranimo opened this issue 10 years ago • 2 comments

Currently the following won't work.

var a = ['a', 'b', 'c'];
var x = {
    template: (
        <ul>
            (a.map(function (i){
                return <li>i</li>
            }))
        </ul>
    )
}

eranimo avatar Oct 21 '15 18:10 eranimo

Hi! Could you describe your use-case? I want to understand how this would fit into the "Angular way" since traditional Angular templates are static HTML.

thesam avatar Dec 10 '15 19:12 thesam

@eranimo is trying to use real jsx code as a template. @thesam I think you should change the description of this package to a more appropriate one, because it's not jsx compatible, it's a way to put templates inline, but you can't use jsx syntax.

In my case, I am making this with angular 1.5 components and Babel ES6 syntax:

let appComponent = {
  restrict: 'E',
  template: `
  <div class="app">
    <div ui-view></div>
  </div>
  `
}

export default appComponent

anaibol avatar Jan 28 '16 09:01 anaibol