I would like to construct a single page app. When a user clicks on a particular object I would like to replace the current component on the page with another component. The code below is situated in a directive of a component and I am able to dynamically swap out whichever component I like. However when I swap my current component to <detail></detail>
I would also like to pass some information to <detail></detail>
so that it can manipulate this information in its controller and display this info within its template.
How would I go about doing something such as this?
var linkFunction = function (scope, element, attributes) {
scope.$ctrl.viewDetails = function() {
$('#page-wrapper').html($compile('<detail></detail>')(scope));
}
};