loadmethod, you have to first inject the router into your component. This can be done easily by using the
IRouterdecorator on your component constructor method. The following code will add a property to your component called
routerwhich we can reference.
loadmethod can accept a simple string value allowing you to navigate to another component without needing to supply any configuration options.
productand passing a parameter value of
12which is the product ID we will check for from within the product component.
loadmethod can accept an object which contains the component we want to render (either the instance or the string name` as well as an object called parameters.
loadconfiguration object. In this example, we are specifying we want to render our product component inside of the viewport named
loadattribute which works the same way as the router instance