Created
September 2, 2016 00:01
-
-
Save omniosi/d474f3ee0382705407237eda5f365096 to your computer and use it in GitHub Desktop.
angular1-router-states
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h3>Its the UI-Router hello world app!</h3> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myApp = angular.module('helloworld', ['ui.router']); | |
myApp.config(function($stateProvider){ | |
var helloState = { | |
name: 'hello', | |
url: '/hello', | |
template: '<h3>hello world!</h3>' | |
} | |
var aboutState = { | |
name: 'about', | |
url: '/about', | |
// template: '<h3>Its the UI-Router hello world app!</h3>' | |
templateUrl: 'about.html' | |
} | |
$stateProvider.state(helloState); | |
$stateProvider.state(aboutState); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="lib/angular.js"></script> | |
<script src="lib/angular-ui-router.js"></script> | |
<script src="helloworld.js"></script> | |
<style> | |
.active{ | |
color: red; | |
font-weight: bolder; | |
} | |
</style> | |
</head> | |
<body ng-app="helloworld"> | |
<a ui-sref="hello" ui-sref-active="active">Hello</a> | |
<a ui-sref="about" ui-sref-active="active">About</a> | |
<ui-view></ui-view> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment