Harish Paudel Harish Paudel - 1 year ago 73
AngularJS Question

AngularJS: Construct ui-states from array of template strings

I have static template files (around 50) and I would like to construct ui-states from these template array

var templates = ['index.html','about.html','contact.html','careers.html']

and my state would simply go like this :


Can I achieve like this?


Answer Source

simply forEach through your templates and create a state per each template

var templates = [

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download