Maz Maz - 1 year ago 80
AngularJS Question

How to use AngularJS UI Router?

I'm trying to use AngularJS UI Router to load view1 and view2, but they're being not loading into the index.html page. Can you please help?

This is the link to whole project in Plunker

Also below, is the index.html page code:

<!DOCTYPE html>
<html lang="en" ng-app="myApp">

<meta charset="utf-8" />
<title>AngularJS Routing</title>
<script data-require="angular.js@*" data-semver="2.0.0" src=""></script>
<script data-require="ui-router@*" data-semver="1.0.0-alpha.5" src="//"></script>
<link rel="stylesheet" href="style.css" />

<ul class="menu">
<a ui-sref="view1">view1</a>
<a ui-sref="view2">view2</a>
<a ui-sref="index">Home</a>
<div>Below you should see the partial view :) ... </div>
<div ng-view="">
<p>ng-view should be loading data from about.html right here but it's not working</p>

<script src="app.js"></script>

<script src="controllers.js"></script>


Answer Source

It should be ui-view instead of ng-view

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