neehu
neehu

Reputation: 132

Unable to compile Dynamic Html using $compile

I am trying to add dynamic html to my code using below lines

var el = $compile('<a ng-controller=\"tableController\" ng-click=\"open\">...ReadMore</a>')($scope);

However it is producing the below error enter image description here

Can anyone help?

Upvotes: 4

Views: 54

Answers (1)

Shohel
Shohel

Reputation: 3934

You missed the parentheses of the open method, The following code should be work.

var el = $compile('<a ng-controller=\"tableController\" ng click=\"open()\">...ReadMore</a>')($scope);

Upvotes: 1

Related Questions