I am new to angular and creating a small project using angular ui-router. After going to documents, I have created the sample flow. But I got stuck in passing the json value to the template.
- I am unable to paint the json on the page, if i add the normal string in my html then it is coming fine, this is happening once i navigate from one screen to another screen.
- Unable to navigate to the back on click of back button.
This is what I tried:
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Angular Demo</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.3.1/angular-ui-router.min.js"></script>
</head>
<body ng-app="myApp" ng-controller="appController">
<div class="container" ui-view>
<div id="div1">
<ul>
<li ng-repeat="x in data"><a ui-sref="test">{{ x.id }}</a></li>
</ul>
</div>
</div>
<script type="text/javascript" src="app.js"></script>
<script type="text/javascript" src="controller.js"></script>
</body>
</html>
ui-sref="/"
intest.html
. That is not a valid state name – Phil 18 hours ago