I have the following ui-router configuration in my angular app:
app.config(["$stateProvider", function ($stateProvider) {
$stateProvider
.state("state1", {
controller: "controller",
templateUrl: "mytemplate.html"
})
app.controller("controller"....
In the controller I call a google cloud endpoint API:
gapi.client.myapi.method().then(function (resp){
}, function (error) {
});
How can I add html using the data from the API response? Is using a directive the best approach?
UPDATE:
I forgot to mention that the response is from an insert method, this means that this will be executed several times, and each time I need to add the response to the existing elements, like in a timeline way.