Другой вопрос мог бы/был бы заказать скриптов, загружающих на страницу. Это ток (не работает):
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js" ></script>
// angular is not in play yet here
<dnn:DnnJsInclude runat="server" FilePath="/app/app.module.js" />
<dnn:DnnJsInclude runat="server" FilePath="/app/Controller/CreateCustomerController.js" />
<dnn:DnnJsInclude runat="server" FilePath="/app/Interface/Interface.js" />
// too late....
<dnn:DnnJsInclude runat="server" FilePath="/Scrpts/angular.js" />
<dnn:DnnJsInclude runat="server" FilePath="/Scrpts/angular.min.js" />
<dnn:DnnJsInclude runat="server" FilePath="/app/app.routes.js" />
...
Мы должны использовать этот порядок определения:
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js" ></script>
// ANGULAR First
<dnn:DnnJsInclude runat="server" FilePath="/Scrpts/angular.js" />
<dnn:DnnJsInclude runat="server" FilePath="/Scrpts/angular.min.js" />
<dnn:DnnJsInclude runat="server" FilePath="/app/app.routes.js" />
// angular is now ready to start solve app
<dnn:DnnJsInclude runat="server" FilePath="/app/app.module.js" />
<dnn:DnnJsInclude runat="server" FilePath="/app/Controller/CreateCustomerController.js" />
<dnn:DnnJsInclude runat="server" FilePath="/app/Interface/Interface.js" />
...
После обновления ... есть 3 раза определенные угловые:
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"> </script>
<dnn:DnnJsInclude runat="server" FilePath="~/DesktopModules/Customer.New/Scripts/angular.js" />
<dnn:DnnJsInclude runat="server" FilePath="~/DesktopModules/Customer.New/Scripts/angular.min.js" />
<dnn:DnnJsInclude runat="server" FilePath="~/DesktopModules/Customer.New/app/app.routes.js" />
<dnn:DnnJsInclude runat="server" FilePath="~/DesktopModules/Customer.New/app/app.module.js" />
...
это нехорошо (возможно, работает, но не хорошо) должно быть только один раз
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"> </script>
// just once
<dnn:DnnJsInclude runat="server" FilePath="~/DesktopModules/Customer.New/app/app.routes.js" />
<dnn:DnnJsInclude runat="server" FilePath="~/DesktopModules/Customer.New/app/app.module.js" />
...
Весь код сейчас должен быть загружен в правильном порядке. Но так как он бросает ошибку ... другие проблемы, я могу видеть это содержание Module.js
// this is typescript
((): void=> {
var app = angular.module("CustomerNew", ['ngRoute']);
app.config(CustomerNew.Routes.configureRoutes);
})()
, который должен быть составлен:
(function() {
var app = angular.module("CustomerNew", ['ngRoute']);
app.config(CustomerNew.Routes.configureRoutes);
})();
И ОСНОВНОМ, нам нужно UI-Router
, не ngRoute
:
(function() {
var app = angular.module("CustomerNew", ['ui.router']);
app.config(CustomerNew.Routes.configureRoutes);
})();
The ui.rou ter 'должен быть введен в основной модуль. Проверить that example ...со всеми действительно запущенными
Можете ли вы разместить полное сообщение об исключении? – masimplo
@ mxa055 опубликовали завершенное исключение ... –