|
<!-- The main application HTML --> |
|
<div class="container" ng-app="app"> |
|
<div ui-view/> |
|
</div> |
|
|
|
<!-- Template for state app --> |
|
<script type="text/ng-template" id="/component.app.html"> |
|
<base-nav title="{{$ctrl.name}}" text="{{$ctrl.version}}" items="$ctrl.items"></base-nav> |
|
<div ui-view/> |
|
</script> |
|
|
|
<!-- Template for the app.index state --> |
|
<script type="text/ng-template" id="/component.app.index.html"> |
|
<h1>Hello :)</h1> |
|
<p>This is a template with Angular 1.5.*, UI-Router 1.0.* and Bootstrap 3.*.</p> |
|
<p>A couple of notes on this template:</p> |
|
<ul> |
|
<li>It is created to have a base with recent versions of these libraries</li> |
|
<li>It is well structured (according to me ;))</li> |
|
<li>Angular 1.5.* is used for its components</li> |
|
<li>UI-Router 1.* can directly route to these component using the <code>component</code> key.</li> |
|
<li>Templates are defined in the HTML of this pen as <code>text/ng-template</code> scripts</li> |
|
<li>The <code><base-nav></code> component inspects the state for the key <code>menuLabel</code> to add menu items dynamically</li> |
|
</ul> |
|
|
|
<p>Using and extending this template should be fairly straighforward.</p> |
|
<p>Let me know if you have any questions or suggestions!</p> |
|
|
|
<hr /> |
|
<div class="text-center"> |
|
<a href='https://github.com/beeman/'><i class="fa fa-fw fa-2x fa-github"></i></a> |
|
<a href='mailto:[email protected]'><i class="fa fa-fw fa-2x fa-envelope"></i></a> |
|
<a href='https://twitter.com/beeman_nl'><i class="fa fa-fw fa-2x fa-twitter"></i></a> |
|
</div> |
|
</script> |
|
|
|
<!-- Template for the app.about state --> |
|
<script type="text/ng-template" id="/component.app.about.html"> |
|
<h1>About</h1>Tell something about your app! |
|
</script> |
|
|
|
<!-- Template for the base.nav component --> |
|
<script type="text/ng-template" id="/component.base.nav.html"> |
|
<nav class="navbar navbar-default"> |
|
<div class="container-fluid"> |
|
<div class="navbar-header"> |
|
<a class="navbar-brand" href="" ui-sref="app.index">{{$ctrl.title}}</a> |
|
</div> |
|
<div class="navbar-collapse"> |
|
<ul class="nav navbar-nav"> |
|
<li ui-sref-active="active" ng-repeat="item in $ctrl.items"> |
|
<a href="#" ui-sref="{{item.sref}}">{{item.label}}</a> |
|
</li> |
|
</ul> |
|
<p class="navbar-text navbar-right">{{$ctrl.text}}</p> |
|
</div> |
|
</div> |
|
</nav> |
|
</script> |