How to pass parameter via ng-view to corresponding route in AngularJS SPA?
<p>I have angular SPA with routing defined, main page is basically like this:</p>

<pre><code>&lt;ng-view&gt;&lt;/ng-view&gt;
</code></pre>

<p>As you know partial templates through routing will be loaded into <code>&lt;ng-view&gt;</code></p>

<p>Now, I need to pass a parameter <code>wonum</code> (Work Order Number) for each route.</p>

<p>I want to know if its possible to assign <code>wonum</code> as an attribute to <code>&lt;ng-view&gt;</code> and be able to access this param, like this:</p>

<pre><code>&lt;ng-view wonum="BRK18482020"&gt;
</code></pre>

<p><strong>Any way this could be accomplished ??</strong></p>

<p>When the page first loaded, <code>wonum</code> param comes as URL parameter:</p>

<p><a href="http://localhost/RealSuiteApps/RealHelp/-1/Detail/?wonum=BRK18482020" rel="nofollow noreferrer">http://localhost/RealSuiteApps/RealHelp/-1/Detail/?wonum=BRK18482020</a></p>

<p>Now, </p>

<p>when partial templates are loaded into <code>&lt;ng-view&gt;</code>, this <code>wonum</code> parameter is no longer available in URL. The question is - how can I make <code>wonum</code> parameter available for each route?</p>

<p>I tried to add <code>wonum</code> parameter to the routing, like this:</p>

<pre><code>        .when("/:wonum", { templateUrl: "Template?name=Main", controller: "DetailController", controllerAs: "vm" })
        .when("/ServiceProvider:wonum", { templateUrl: "Template?name=ServiceProvider", controller: "DetailController", controllerAs: "vm" })
        .when("/AssetGroup:wonum", { templateUrl: "Template?name=AssetGroup", controller: "DetailController", controllerAs: "vm" })
</code></pre>

<p>How do I actually pass a value here?
And how can I read that param?</p>

<p>Another option of which I was asking - is it possible to assign this param to <code>ng-view</code> as an attribute and then read it in my angular controller ?</p>