Code is not working

27 views
Skip to first unread message

mukul kant

unread,
Jun 1, 2015, 2:47:29 AM6/1/15
to ang...@googlegroups.com
Hi,

I am very new in angular below code is not working can anybody please help
 


<!DOCTYPE html>
<html ng-app="sampleApp">
<head>
    <title>AJ</title>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
</head>
<body>
        <ul class="nav">
            <li><a href="#AddNewOrder"> Add New Order </a></li>
            <li><a href="#ShowOrders"> Show Order </a></li>
        </ul>

   <div ng-view></div>




Script:-



var sampleApp = angular.module('sampleApp', []);

sampleApp.config(['$routeProvider',
  function($routeProvider) {
    $routeProvider.
      when('/AddNewOrder', {
        templateUrl: 'templates/add_order.html',
        controller: 'AddOrderController'
    }).
      when('/ShowOrders', {
        templateUrl: 'templates/show_orders.html',
        controller: 'ShowOrdersController'
      }).
      otherwise({
        redirectTo: '/AddNewOrder'
      });
}]);

Samuel Castro e Silva

unread,
Jun 1, 2015, 4:29:27 AM6/1/15
to ang...@googlegroups.com
is there some error/exception in your console log?

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.



--

Samuel Castro

Full Stack Developer

(37) 9110-8850

mukul kant

unread,
Jun 1, 2015, 4:55:20 AM6/1/15
to ang...@googlegroups.com
Nope, here is no error. But problem is page is not render on another page.


--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/yWJTByjUVgg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.

To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Sander Elias

unread,
Jun 1, 2015, 9:03:55 AM6/1/15
to ang...@googlegroups.com
Hi,

I did put your code in a plunk, and it work like a charm :) http://plnkr.co/edit/wCAJbiqSUuxAD2ut9bux?p=preview
(you did forget to load and inclide the router!)

Regards
Sander Elias

Reply all
Reply to author
Forward
0 new messages