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 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 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.