/ - Visual Studio, Angular SPA. , , :
- VS . ASP.NET(MVC)
- / (, , , )
- ( Entity) (, Employee/)
- , .. view, controller, test (ng-boilerplate)
/
// external libs
Scripts
Scripts / angular.js
Scripts / ui-bootstrap-x.y.js
Scripts / ...
// project libs
MyApp
MyApp / Module
MyApp / Module / Employee
MyApp / Module / Employee / Employee.state.js // state machine settings
MyApp / Module / Employee / EmployeeList.ctrl.js // controllers
MyApp / Module / Employee / EmployeeDetail.ctrl.js
MyApp / Module / Employee / DisplayEmployee.dirc.js // directive
MyApp / Module / Employee / Employee.spec.js // tests
// similar for other stuff
...
, / js:
- ". dirc.js" -
- ". ctrl.js" -
- ". spec.js" -
- ...
, Bundle:
bundles.Add(new ScriptBundle("~/js/app")
.Include("~/MyApp/app.js")
.Include("~/MyApp/app.config.js")
.IncludeDirectory("~/MyApp/", "*.module.js", true)
.IncludeDirectory("~/MyApp/", "*.dirc.js", true)
.IncludeDirectory("~/MyApp/", "*.ctrl.js", true)
.IncludeDirectory("~/MyApp/", "*.state.js", true)
...
);
, , ...
index.cshtml
<html data-ng-app="MyApp">
<head>
...
@Styles.Render("~/Content/css")
</head>
<body>
<div class="body" data-ui-view="body"></div>
@Scripts.Render("~/js/angular")
@Scripts.Render("~/js/app")
</body>
web.config <compilation debug="true" , .
debug="false" JS