Thursday, 17 November 2016

angularjs - Pass object to template and render it on current view

There is a list of users loaded from an api






When a user is clicked I want to open an extra view that shows some detailed information of the user. Imagine the view like this



enter image description here



The small blue area is the selected user and the big blue area the container that shows detailed user information.



function UserController($scope){

$scope.select = function(user){
console.log(user);
}
}


So when the user is clicked I can log the user object. It works until this point. But I absolutely have no idea how to open the extra container filled with user data.



Is there a way to simply load a template from file system, pass the object and append the whole thing to the current view? How would I do this with angular.js?

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...