Yuting Guo from

I put the Thymeleaf th: in angular2 templates, but the th: wont compile. Is there any way I can use them together?

import {Component, NgModule} from '@angular/core'
import {BrowserModule} from '@angular/platform-browser'


@Component({
     selector: 'my-app',
     template: `
     <table xmlns:th="http://www.w3.org/1999/xhtml">
         <tbody>
            <tr>
                <th>User Name</th>
                <th th:each="role : ${roles}">
                   <div class="row">
                       <div th:text="${role.type}"></div>
                   </div>
                </th>
            </tr>
        </tbody>
    </table>`,
    })
export class App {}

Leave a answer:


Related Questions

Sending an HTTP request with headers in Angular2

I am trying to build an app that connects to the twitter api. To accomplish this, I need to send a http get request with a set of headers using...