Estoy desarrollando con Angularjs2.
Como primera etapa fue en crear por cada modulo o pantalla su propio controller.
Una vez finalizada las pantalla. Como segunda etapa fue en crear un Menu para llamar a las distintas pantallas.
El problema que tengo es que no puedo definir dos <Sripts> por cada controller, por que una de ellas me da un error : angular.js:9778 Error: [ng:areq] Argument 'controllerIngresarStock' is not a function, got undefined
Definir Scripts de esta fomra en mi index.html
<script src="app/js/controllers.js"></script>
<script src="app/js/controllerIngresarStock.js"></script>
<script src="app/js/controllerListadoPedido.js"></script>
Me quedo atento a sus comentarios.
Saludos.
Envio Codigo Completo:
Código HTML :
<!doctype html> <html lang="en" ng-app="myApp" ng-controller="AppCtrl"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Sistemas de Inventario</title> <!-- Bootstrap --> <link href="bower_components/bootstrap/less/bootstrap.css" rel="stylesheet"> <link href="bower_components/css-toggle-switch/dist/toggle-switch.css" rel="stylesheet"> <link href="bower_components/rangeslider.js/dist/rangeslider.css" rel="stylesheet"> <link href="css/maverix.css" rel="stylesheet"> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="sidebar"> <div class="sidebar-navicontainer"> <div class="sidebar-headbox"> <span class="sidebar-header">Pedido</span> <a class="sidebar-toggle">Hide</a> </div> <ul class="nav"> <li ng-class="{ selected: isActive('/type')}"><a href="#/type"><span class="entypo-behance"></span> Typography</a></li> <li ng-class="{ selected: isActive('/IngresarStock')}"><a href="#/IngresarStock"><span class="entypo-behance"></span> Ingresar</a></li> <li ng-class="{ selected: isActive('/ListadoPedidos')}"><a href="#/ListadoPedidos"><span class="entypo-behance"></span> Listado</a></li> </ul> </div> </div> <div class="heading-bar"> <!--<div class="user-bar"> Hi, Username | <a href="#">Sign out</a> </div>--> <span class="heading-one"><img ng-src="{{img}}" width="48" height="48"> {{title}}</span> </div> <div class="content"> <div class="container-fluid container-maverix" ng-view> </div> </div> <!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> <!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>--> <script src="bower_components/jquery/dist/jquery.min.js"></script> <!-- Include all compiled plugins (below), or include individual files as needed --> <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script> <script src="bower_components/rangeslider.js/dist/rangeslider.min.js"></script> <script src="bower_components/flot/jquery.flot.js"></script> <script src="bower_components/flot/jquery.flot.pie.js"></script> <!-- In production use: <script src="//ajax.googleapis.com/ajax/libs/angularjs/x.x.x/angular.min.js"></script> --> <script src="bower_components/angular/angular.js"></script> <script src="bower_components/angular-route/angular-route.js"></script> <script src="app/js/app.js"></script> <script src="app/js/services.js"></script> <script src="app/js/controllers.js"></script> <script src="app/js/controllerIngresarStock.js"></script> <script src="app/js/controllerListadoPedido.js"></script> <script rel="stylesheet" src="blockui-master/jquery.blockUI.js"></script> <script src="http://cdn.jsdelivr.net/typeahead.js/0.9.3/typeahead.min.js"></script> <script src="app/js/filters.js"></script> <script src="app/js/directives.js"></script> <script src="alertify.js-0.3.11/lib/alertify.min.js"></script> <link rel="stylesheet" href="css/estilo.css"> <link rel="stylesheet" href="alertify.js-0.3.11/themes/alertify.core.css" /> <link rel="stylesheet" href="alertify.js-0.3.11/themes/alertify.default.css" /> <script> $(document).ready(function () { // Sidebar Toggle Button Initialization $(".sidebar-toggle").click(function (event) { var $nextUl = $(event.target).parents().eq(1).find("ul.nav"); if (event.target.innerText === "Show") { event.target.innerText = "Hide"; } else { event.target.innerText = "Show"; } $nextUl.slideToggle("fast", "swing"); }); $(document).on("focus", function (e) { console.log("Focussed"); }); $(window).on('focus', function () { $("body").removeClass("blur"); }); $(window).on('blur', function () { $("body").addClass("blur"); }); // Rangeslider $('input[type="range"]').rangeslider({ // Feature detection polyfill: false }); }); </script> </body> </html>
VISTA