Это веб-приложение для узлов.
Это сводит меня с ума ....
Все работает нормально Chrome / FF / Edge - но в IE 11 он говорит, что контроллер не зарегистрирован.
однако контроллеры, созданные моим коллегой, работают на IE 11, и мы не видим разницы, я понятия не имею, что я делаю неправильно.
Это clientApp.js:
/**
*/
var clientapp = angular.module("clientApp", ['ngRoute', 'ngFileUpload', 'mgcrea.ngStrap', 'ngSanitize', 'ngMaterial', 'nvd3','ui.bootstrap']);
//, 'uiGmapgoogle-maps']);
clientapp.config(['$routeProvider', '$locationProvider', '$httpProvider',/*'uiGmapGoogleMapApiProvider',*/ function ($routeProvider, $locationProvider, $httpProvider) {//}, mapProvider){
/*
mapProvider.configure({
key: 'AIzaSyDX4bBNsyJlMePfc-',
v: '3',
libraries: 'weather,geometry,visualization'
});
*/
$httpProvider.defaults.withCredentials = true;
$locationProvider.hashPrefix("");
$routeProvider
.when("/", {
controller: "dashboardHome-controller",
templateUrl: "./views/home.html"
})
.when("/login", {
controller: "login-controller",
templateUrl: "./views/login.html"
})
.when("/logout", {
controller: "login-controller",
templateUrl: "./views/logout.html"
})
.when("/ubiq/invoices", {
controller: "invoice-controller",
templateUrl: "./views/ubiq-listInvoices.html"
})
.when("/ubiq/invoiceHistory", {
controller: "invoice-controller",
templateUrl: "./views/ubiq-invoiceHistory.html"
})
.when("/error/:message", {
controller: "login-controller",
templateUrl: "./views/error.html"
})
.when("/ubiq/rates", {
controller: "rates-controller",
templateUrl: "./views/list-rates.html"
})
.when("/ubiq/creditLimits", {
controller: "credit-limit-controller",
templateUrl: "./views/list-creditLimits.html"
})
.when("/ubiq/creditLimitsEdit", {
controller: "credit-limit-edit-controller",
templateUrl: "./views/edit-creditLimits.html"
})
.when("/ubiq/onboardingDocuments", {
controller: "onboardingInfoController",
templateUrl: "./views/onboardingInfo.html"
})
.when("/ubiq/reporting", {
controller: "invoice-reporting-controller",
templateUrl: "./views/invoice-reporting.html"
})
.when("/ubiq/wcacalculators", {
controller: "wca-controller",
templateUrl: "./views/wca-calculators.html"
})
.when("/ubiq/feereport", {
controller: "fee-report-controller",
templateUrl: "./views/fee-report.html"
})
.when("/changePassword", {
controller: "change-password-controller",
templateUrl: "./views/changePassword.html"
})
.when("/ubiq/attachfilestoinvoices", {
controller: "file-attachment-controller",
templateUrl: "./views/attach-files-to-invoices.html"
})
.when("/ubiq/attachcmtoinvoices", {
controller: "cm-attachment-controller",
templateUrl: "./views/attach-cm-to-invoices.html"
})
///prototype pages//
/* .when("/ubiq/protoregistration", {
controller: "jqueryscript",
templateUrl: "./views/prototype-cerf_registration-page.html"
})
.when("/ubiq/protocreateoffer", {
controller: "jqueryscript",
templateUrl: "./views/prototype-cerf_createoffer.html"
})
.when("/ubiq/proto-myongoingauctions", {
controller: "jqueryscript",
templateUrl: "./views/prototype-cerf-myongoingauctions.html"
})
.when("/ubiq/proto-auctionfilter", {
controller: "jqueryscript",
templateUrl: "./views/prototype-cerf_auctionfilter.html"
})
.when("/ubiq/proto-joinauction", {
controller: "jqueryscript",
templateUrl: "./views/prototype-cerf_joinauction.html"
}) */
/// end prototype pages//
.otherwise({
redirectTo: "views/page-not-found.html"
});
}]);
и это один из моих контроллеров для одной из моих страниц:
(function () {
var myApp = angular.module('clientApp');
myApp.controller('dashboardHome-controller', ['$scope', '$filter', '$window', '$http', '$location', '$controller', function ($scope,$filter, $window, $http, $location,$controller) {
//////////////////////////////////////////////////Initializing info/////////////////////////////////////////////////////////////////
global_addUtils($scope);
$scope.initDHPage = function (pageName) {
$scope.arrayInvoideDates = [];
$http.get("/api/ubiq/invoices?pageName=" + pageName).then(function (response) {
$scope.pageName = "Invoice Trading";
$scope.pageInfo = $scope.processResponse(response, $location);
if (!$scope.pageInfo) {
return;
}
global_addNavigation($scope);
$scope.initPageNavigation();
$scope.linesPerPage = 7;
$scope.pageInfo.pageName = pageName;
$scope.invoiceDatesData = $scope.pageInfo.invoices;
console.log("INVOICES XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
var data = $scope.pageInfo.invoices;;
angular.forEach($scope.invoiceDatesData, function (invoice) {
var invoiceDate = new Date(invoice.invoiceDate).toLocaleDateString();
var invoiceUnixTime = new Date(invoice.invoiceDate).getTime();
var invoiceCount = $scope.invoiceDatesData.length;
$scope.soldInvoices = [];
$scope.notsoldInvoices = [];
$scope.pendingSellOffers = [];
angular.forEach(data, function (invoice) {
if (invoice.gwCode === '211111110000' || invoice.gwCode === '211111110100') {
$scope.soldInvoices.push(invoice.gwCode);
}
return $scope.soldInvoices;
});
angular.forEach(data, function (invoice) {
if (invoice.gwCode != '211111110000'
&& invoice.gwCode !='99995'
&& invoice.gwCode !='99994'
&& invoice.gwCode !='999951'
&& invoice.gwCode !='999941'
&& invoice.gwCode !='211111110100' ) {
$scope.notsoldInvoices.push(invoice.gwCode);
}
return $scope.notsoldInvoices;
});
angular.forEach(data, function (invoice) {
if (invoice.gwCode === '211110000000'
||invoice.gwCode === '211111000000'
||invoice.gwCode === '211190000000' ) {
$scope.pendingSellOffers.push(invoice.gwCode);
}
return $scope.pendingSellOffers;
});
$scope.arrayInvoideDates.push({ invoiceUnixTime, invoiceCount })
$scope.filteredDataForIssuedInvoicesChart = data.map(function (invoice) {
$scope.filteredDataForDonut = data.map(function (invoice) {
return $scope.donutdata = [
{ key: "Traded", y: $scope.soldInvoices.length },
{ key: "Not Traded", y: $scope.notsoldInvoices.length }
];
})[0];
return $scope.issuedinvoiceDateData = [
{
"key": "Issued",
"values": [
{
"label": "Issued",
"value": invoiceCount
}]
},
{
"key": "Traded",
"values": [
{
"label": "Traded",
"value": $scope.soldInvoices.length
}
]
}]
});
});
});
///////////////////////////////////////////////////////////////////////Data Charts Options///////////////////////////////////////////////////////////
////////////////////////////////Bar CHART////////////////////////////////
$scope.options = {
chart: {
type: 'discreteBarChart',
height: 350,
x: function (d) { return d.label; },
y: function (d) { return d.value; },
showValues: true,
valueFormat: function (d) {
return d3.format(',.2f')(d);
},
transitionDuration: 500,
xAxis: {
axisLabel: 'Supplier',
rotateLabels: -85
},
yAxis: {
axisLabel: 'CashFlowGain',
axisLabelDistance: 0,
rotateLabels: -90
}
},
title: {
enable: true,
text: "CashFlow Gain Per Supplier",
css: {
position: 'relative',
left: '0px',
top: '50px'
}
},
};
$scope.config = {
extended: true
};
///////////////////////////////// Stacked Bar chart///////////////////////////////////////////
$scope.IssuedInvoicesChartoptions = {
chart: {
type: 'discreteBarChart',
height:300,
width:300,
x: function (d) { return d.label; },
y: function (d) { return d.value; },
showValues: false,
stacked: false,
transitionDuration: 100,
xAxis: {
xLabelMargin: 60,
rotateLabels: -30
},
yAxis: {
axisLabelDistance: 0,
rotateLabels: 0
}
},
title: {
enable: true,
text: "Issued vs Traded Invoices",
css: {
'font-size':'12px',
position: 'relative',
left: '0px',
top: '10px'
}
},
};
//////////////////////////////////////Pie-Donut Chart//////////////////////////////////////
$scope.donutoptions = {
chart: {
type: 'pieChart',
height:300,
width:300,
donut: false,
x: function (d) { return d.key; },
y: function (d) { return d.y; },
showLabels: true,
duration: 500,
labelThreshold: 0.01,
labelSunbeamLayout: true,
labelType: 'percent',
legend: {
margin: {
top: 5,
right: 35,
bottom: 5,
left: 0
}
}
}
};
$scope.oneF = function (one) { return one };
$scope.twoF = function (two) { return two };
};
}]);
})();
А это его html:
<code><div ng-init= "initDHPage('history')">
<h2 class="sub-header">{{gs("HomeTitle", "Home Page")}} </h2>
<!-- <pre> {{pageInfo.invoices|json}}
->
{{gs ("SnapshotTable", "Таблица моментальных снимков")}} Статус Количество счетов Находящиеся в продаже предложения {{pendingSellOffers.length}} Торговые счета-фактуры (не погашены) {{soldInvoices.length}}
Отлично работает во всех браузерах, кроме IE 11
И это index.html:
<!DOCTYPE html>
<html lang="en" ng-app="clientApp">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="images/favicon.ico">
<title>Fineon</title>
<style>
.angular-google-map-container {
height: 300px;
width: 400px;
}
</style>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<!-- <link href="css/ie10-viewport-bug-workaround.css" rel="stylesheet"> -->
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css">
<!-- Bootstrap core CSS -->
<link href="bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link rel="stylesheet prefetch" href="https://cdnjs.cloudflare.com/ajax/libs/material-design-iconic-font/2.2.0/css/material-design-iconic-font.min.css">
<link href="css/dashboard.css" rel="stylesheet">
<link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="css/tablestyle1.css">
<link rel="stylesheet" href="css/sidebarmenu.css">
<link rel="stylesheet" href="css/style.css" />
<link rel="stylesheet" href="css/tabs.css" />
<!-- <link rel="stylesheet" href="css/prototypecerf.css" /> -->
<link rel="stylesheet" href="/bower_components/angular-material/angular-material.css">
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
<script src="bower_components/angular-animate/angular-animate.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
<script src="bower_components/angular-strap/dist/angular-strap.js"></script>
<script src="bower_components/angular-strap/dist/angular-strap.tpl.js"></script>
<script src="bower_components/angular-simple-logger/dist/angular-simple-logger.min.js"></script>
<script src="bower_components/lodash/dist/lodash.min.js"></script>
<!--<script src="https://rawgit.com/angular-ui/angular-google-maps/2.3.2/dist/angular-google-maps.js"></script>-->
<script src="bower_components/ng-file-upload/ng-file-upload-shim.min.js"></script>
<script src="bower_components/ng-file-upload/ng-file-upload.min.js"></script>
<script src="bower_components/file-saver/FileSaver.js"></script>
<!--Material libs -->
<script src="/bower_components/angular-aria/angular-aria.js"></script>
<script src="/bower_components/angular-animate/angular-animate.js"></script>
<script src="/bower_components/angular-messages/angular-messages.js"></script>
<script src="/bower_components/angular-material/angular-material.js"></script>
<!-- NVD3 libs-->
<!-- <script src="bower_components/angular/angular.js"></script> -->
<script src="bower_components/d3/d3.js"></script>
<script src="bower_components/nvd3/build/nv.d3.js"></script> <!-- or use another assembly -->
<script src="bower_components/angular-nvd3/dist/angular-nvd3.js"></script>
<link rel="stylesheet" href="bower_components/nvd3/build/nv.d3.css">
<script src="bower_components/angular-bootstrap/ui-bootstrap-tpls-2.5.0.js"></script>
<script src="clientapp.js"></script>
<script src="controllers/global-functions.js"></script>
<script src="controllers/simple-crud-functions.js"></script>
<script src="controllers/login-controller.js"></script>
<script src="controllers/invoice-controller.js"></script>
<script src="controllers/topMenuController.js"></script>
<script src="controllers/rates-controller.js"></script>
<script src="controllers/credit-limit-controller.js"></script>
<script src="controllers/credit-limit-edit-controller.js"></script>
<script src="controllers/onboardingInfoController.js"></script>
<script src="controllers/invoice-reporting-controller.js"></script>
<script src="controllers/change-password-controller.js"></script>
<script src="controllers/wca-controller.js"></script>
<script src="controllers/fee-report-controller.js"></script>
<script src="controllers/file-attachment-controller.js"></script>
<script src="controllers/dashboardHome-controller.js"></script>
<script src="controllers/cm-attachment-controller.js"></script>
</head>
<body ng-controller="topMenuController">
<br/>
<nav ng-init="initHomePage()" ng-controller="login-controller" class="navbar navbar-inverse navbar-global navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false"
aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div> <a class="navbar-brand" href="#"><img class="img-responsive" src="images/fineon.png" alt="UbiQ Trade Finance"></a> </div>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-user navbar-right">
<li><a href=""><span class="glyphicon glyphicon-user"></span> {{pageInfo.company.name}}</a></li>
<li><a href="#/logout"><span class="glyphicon glyphicon-log-out"></span> Logout</a></li>
</ul>
</div>
</div>
</nav>
<nav id="navbarprimary" ng-class="active ? 'navbar-primary collapsed' : 'navbar-primary'" >
<a class="btn-expand-collapse" ng-click="activeButton1()"><span class="glyphicon glyphicon-menu-left"></span></a>
<ul class="navbar-primary-menu">
<li ng-repeat="menuSection in menuItems" class="special dropdown">
<a ng-click="activeButton2()" href="" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><span class="glyphicon" ng-class="getClassForGlyph(menuSection.permissions[0].category)"></span><span class="nav-label ">{{menuSection.category}}</span></a>
<ul class="dropdown-menu specialdropdown">
<li ng-repeat="menuItem in menuSection.permissions"><a href="{{menuItem.path}}"><span class=""></span><span class="nav-label "> {{menuItem.name}}</span></a></li>
</ul>
</li>
</ul>
</nav>
<div class="main-content">
<div ng-view></div>
</div>
</body>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<!-- <script src="bower_components/jquery.min.js"></script> -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"></script>
<script src="controllers/jqueryscript.js"></script>
<script>
window.jQuery || document.write('<script src="../../assets/js/vendor/jquery.min.js"><\/script>')
</script>
<script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- Just to make our placeholder images work. Don't actually copy the next line! -->
<script src="getbootstrapassets/js/vendor/holder.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="getbootstrapassets/js/ie10-viewport-bug-workaround.js"></script>
</html>
Хорошо, пока?
И это контроллер моего коллеги, который отлично работает на IE 11, я выбрал самый маленький, чтобы сделать егоВам проще:
var clientModule = angular.module('clientApp');
clientModule.controller('change-password-controller',
['$scope', '$http', '$routeParams', '$location', '$window', function ($scope, $http, $routeParams, $location, $window) {
global_addUtils($scope);
$scope.initPage = function () {
$scope.pageName = "Change Password";
$scope.pageContent = {};
$http.get("/api/changePasswordPage").then(function(response){
$scope.pageInfo = $scope.processResponse(response, $location);
}, function (errorData) {
$location.path("/error/There was an error in " + $scope.pageName);
});
};
$scope.changePassword = function(){
$http.post("/api/changePassword", $scope.pageContent).then(function(response){
if (response.data.isSuccessful){
$scope.message = "Password Changed Successfully";
} else {
if (response.data.message === "missmatch"){
$scope.message = "Password and its repetition do not match";
} else if (response.data.message === "wrongpass"){
$scope.message = "Current password does not match";
} else {
$scope.message = "There was a problem changing passwords";
}
}
});
console.log($scope.pageContent);
};
}]
);
А это его html-страница:
<div align="center">{{message}}</div>
<h2 class="sub-header">{{gs("changePasswordTitle", "Change Password")}}</h2>
<label for="currentPassword" class="sr-only">{{gs("currentPassword", "Current Password")}}</label>
<input style="width:50%" id="currentPassword" ng-model="pageContent.oldPassword" class="form-control" placeholder="{{gs('currentPassword', 'Current Password')}}" required autofocus dir="{{pageInfo.language.dir}}">
<br />
<label for="newPassword" class="sr-only">{{gs("newPassword1", "New Password")}}</label>
<input style="width:50%" id="newPassword" ng-model="pageContent.newPassword" class="form-control" placeholder="{{gs('newPassword1', 'New Password')}}" required autofocus dir="{{pageInfo.language.dir}}">
<br />
<label for="newPassword2" class="sr-only">{{gs("newPassword2", "Repeat Password")}}</label>
<input style="width:50%" id="newPassword2" ng-model="pageContent.newPasswordConfirm" class="form-control" placeholder="{{gs('newPassword1', 'New Password')}}" required autofocus dir="{{pageInfo.language.dir}}">
<br />
<button style="width:50%" ng-click="changePassword()" class="btn btn-lg btn-primary btn-block">{{gs("loginButton", "Log In")}}</button>
Какая разница ???Почему его контроллеры работают на IE11, а мои - нет?