I have html theat I want to use in angularjs controller controller. My problem is to escape the html in the angularjs controller. Here is my snippet
function($scope) { $scope.data= <table class="table"> <thead> <tr> <th>#</th> <th>First Name</th> <th>Last Name</th> <th>Username</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>$rootScope.firstname</td> <td>$rootScope.lastname</td> <td>@mdo</td> </tr> <tr> <td>2</td> <td>$rootScope.firstname1</td> <td>$rootScope.lastname1</td> <td>@fat</td> </tr> <tr> <td>3</td> <td>$rootScope.firstname2</td> <td>$rootScope.lastname2</td> <td>@twitter</td> </tr> </tbody> </table>;
how can I pass the table html and the root scope data into scope.data variable