JavaScript Inline template in angular with dynamic url inline template angular 8,inline template angular,inline template angular

Hi I want to use a similar functionality like : Using Inline Templates in Angular

But in my case url will be dynamic. for example in below code url will have /first or /second but in my case it will have the category id. there can be 100 of category so I could not write 100 condition

  learningApp.config(function ($routeProvider) {$routeProvider.
    when("/cat1",{ controller: "SimpleController", templateUrl: "temp1.html"}).
    when("/cat2", {controller: "SimpleController", templateUrl: "temp2.html"}).
    otherwise({redirectTo : "/first"});

});

<script type="text/ng-template" id="cat1.html">
<div class="view">
    <h2>First View</h2>
    <p>
        Search:<input type="text" ng-model="filterText" />
    </p>
    <ul class="nav nav-pills">
        <li ng-repeat="cust in customers | orderBy:'name' | filter: filterText "><a target='_blank' href="#">{{cust.name}} - {{cust.school}}</a></li>
    </ul>
</div>
</script>

<script type="text/ng-template" id="cat2.html">
<div class="view">
    <h2>Second View</h2>
    <p>
       Search:<input type="text" ng-model="filterText" />
    </p>
    <ul class="nav nav-pills">
        <li ng-repeat="cust in customers | orderBy:'name' | filter:    filterText "><a target='_blank' href= "#">{{cust.name}} - {{cust.school}}</a></li>
    </ul>
</div>

and definitely I will have a section with id as category id corresponding to each category.

Answer:1

I created a simple login page, which, once the button is pressed, executes this function : login = (email, password, navigate) => { this.setState({ loginButtonPressed: true }); firebase ....

I created a simple login page, which, once the button is pressed, executes this function : login = (email, password, navigate) => { this.setState({ loginButtonPressed: true }); firebase ....

  1. undefined the function

I need to show the caption div when current item is focused. i am able to show the caption but when second last image focused with cation last image also show caption in loop. In first loop all ...

I need to show the caption div when current item is focused. i am able to show the caption but when second last image focused with cation last image also show caption in loop. In first loop all ...

I often read that I should not use HTML's onclick attribute because it decrease code readability. Instead I should make event listener in my script.js. So what do you think about v-on:click? Is it ...

I often read that I should not use HTML's onclick attribute because it decrease code readability. Instead I should make event listener in my script.js. So what do you think about v-on:click? Is it ...

I'm working on the router in Vue js. I display the current link in Navbar by adding style for router-link-active and exact property for each <router-link>. It's work fine. But now I'm trying to ...

I'm working on the router in Vue js. I display the current link in Navbar by adding style for router-link-active and exact property for each <router-link>. It's work fine. But now I'm trying to ...