Saturday, October 21, 2017

why providerRoute is not working

    var app = angular.module('MyApp', ['ngRoute']);
app.config(function ($routeProvider) {
    $routeProvider
        .when("/Home", {
            templateUrl: "Home/EmployeeList",
            controller: "listController",
        })
        .when("/Home1", {
            templateUrl: "Home/EmployeeTable",
            controller: "tableController",
        })
        .otherwise({
            redirectTo: "/Home/Index"
        })
        .controller("listController", function ($scope) {
            $scope.message = "In list controller";
        })
});

why on running code TypeError:routeProvider.when(…).when(…).otherwise(…).controller error shows in cosole.

Source: AngularJS



from Angular Questions https://angularquestions.com/2017/10/21/why-providerroute-is-not-working/
via @lzomedia #developer #freelance #web #lzomedia.com

No comments:

Post a Comment