I just started working with AngularJS but I found a small problem that I cant find out, I hope you peeps can help me.
I have imported AngularJS Gridster, a simple way to add a dynamic grid to your webpage. Now everything works and the element get succesfully loaded from the database and imported in Gridster but now I want to do the following thing. In the JSON that is retrieved from the database there is also an attribute called "directive". Now, when everything is loaded I want to add in each Gridster element the directive that is returned from the database.
<ul>
<li gridster-item="item" ng-repeat="item in gridsterItems">
{{ item.directive }} // Returns <clock-widget></clock-widget> and print it to the screen, but it dont run the directive and doesn't display.
</li>
</ul>
Now it returns the right value and display the string on the screen but I want to run it directive clockWidget.
app.directive('clockWidget', function() {
return {
replace: true,
template: 'Yups, I am the clockwidget',
};
});
On the internet I read something about $compile but I can't find out. I hope you peeps can help me.
Thanks!