Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Trying to get a simple Angularjs example to work in ASP.NET using MVC 4 Web Application Template but no luck. No errors but the view is not displayed ??? All files are in root dir of the ASP.Net project. Index.html is the start page

Thanks

my list.html for view

<h1>Test {{message}}</h1>

my index.html with all angularjs code here

<!DOCTYPE html>
<html  ng-app="app" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <script src="Scripts/bootstrap.js"></script>-->
    <script src="Scripts/angular.min.js"></script>
    <script src="Scripts/angular-resource.min.js"></script>
    <script src="Scripts/angular-route.min.js"></script>

    <script>
        var app = angular.module('app', ['ngRoute']);
        app.config(['$routeProvider', function ($routeProvider) {
        $routeProvider
                .when('/', {
                    templateUrl: 'list.html',
                    controller: 'MyController'
                })
                .otherwise('/')
    }]);
    app.controller('MyController', function ($scope) {
        $scope.message = "this is message from controller"
    })
</script>
<link rel="stylesheet" type="text/css" href="Content/bootstrap.css" />
<title>My Application</title>

</head>
<body>
<div class="container">
<div ng-view></div>
</div>
</body>
</html>
share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.