Compare Page Revisions
« Older Revision - Back to Page History - Newer Revision »
/Scripts/MyAngularApp
app.js
var myAngularApp = angular.module("myAngularApp", ["ngResource"]). config(function ($routeProvider) { $routeProvider .when('/Team', { controller: 'TeamDashboardController', templateUrl: 'AngularTemplates/TeamDashboard.html' }) .otherwise({ redirectTo: '/Team' }); });
/Views/Shared/_Layout.cshtml
ng-app
html
angular.min.js
@{ Layout = null; } <html> <head> <script src="~/Scripts/angular.min.js"></script> <script src="~/Scripts/angular-resource.min.js"></script> <script src="/Scripts/MyAngularApp/app.js"></script> <script type="text/javascript" src="/Scripts/MyAngularApp/controllers/TeamDashboardController.js"></script> @RenderSection("head", required: false) </head> <body ng-app="myAngularApp"> <h1>My Angular App</h1> @RenderBody() </body> </html>
/Home/Index
ng-view
<div ng-view></div>
/AngularTemplates
TeamDashboard.html
<h3>This is the Team Dashboard</h3> {{ message }}
/Scripts/MyAngularApp/controllers
TeamDashboardController.js
'use strict'; myAngularApp.controller('TeamDashboardController', function ($scope) { $scope.message = "Hello world!"; });
message
/Scripts/MyAngularApp/services
ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.