Angular js not responding - help needed - angularjs

This is my cshtml
When I run my code on local host the table just flickers and disappears and also it fails to bind any data.
I'm using visual studio 2015 community and running on .NetCOre 1.0
I'm using Angular 1.5.7
I would appreciate any help.
My angular module declaration in apptrips.js:
(function () {
// Creating the Module
angular.module("apptrips", []);
})();
This is where the module is defined and a tripsController function is defined
Below i have the following console error in browser
O Uncaught Error: [Sinjector:nomod] http://errors.angul angular.is:2075 aris .org/1.5.7/Siniector/nomod?p0=app-trips at angular.is:38 at angular.~is:2075 at b (angular.is:1999) at Object.module (angular.is:2073) at tripsController.is:5 at tripsController.is: 14
© ► Error: [ng:areq] http://errors.angularis.org/1.5. angular.is:13708 7/ng/area?p0=tripsController&pl=not%20a%20function%2C%20got%20undefine d
at angular.is:38 at sb
(angular.is:1885) at Qa
(angular.is:1895) at
angular.is:10210 at ag
(angular.is:9331) at m
(angular.is:9116) at g
(angular.is:8510) at g
(angular.is:8513) at
angular.is:8390 at angular.is:1756

Error: [ng:areq] http://errors.angularis.org/1.5. angular.is:13708 7/ng/area?p0=tripsController&pl=not%20a%20function%2C%20got%20undefine d
Error indicates that the tripsController is not found/loaded.
Did you include the js file having the controller into your main index file?

Related

Failed to instantiate module ui-mask angulajs with rquirejs

I need to mask my input in my application. I was using ngMask in angularjs. But i found an issue in ngMask is that if we update the mid value the cursor move to end. I tried to resolve the issue but did not find anything. Even on github this issue has reported but still not resolved. Here is the link
ngMask Issue
Then i decided to use another mask library. I found ui-mask and trying to use in my application but i am getting error when i include in my project. My application is in angularjs and i am using requirejs as well to load the modules.
This is what i have done in main.js:
paths: {
...////
"angular-ui-mask": "../../lib/ui-mask/ui-mask.min",
},
'angular-ui-mask': {
deps: ['angular'],
exports: 'angular-ui-mask'
},
in app.js i have done:
var app = angular.module("app",
[
"ui.router",
"mobile-angular-ui",
"scrollable-table", //for alert triggering
"rzModule", //slider for SEMI diagram
"isteven-multi-select",
"ui.bootstrap",
"cgBusy", "dndLists", 'apm-kpi-widget',
'angular.filter',
"pascalprecht.translate",
"jQueryScrollbar",
"ui.checkbox",
"angular-ui-mask"
])
This is exact i was doing for ngMask. But in this case i am getting error
[$injector:modulerr] http://errors.angularjs.org/1.5.5/$injector/modulerr?
at angular.js:38
at angular.js:4587
at q (angular.js:322)
at g (angular.js:4548)
at bb (angular.js:4470)
at c (angular.js:1746)
at Object.yc [as bootstrap] (angular.js:1767)
at HTMLDocument.<anonymous> (angularAMD.js:449)
at i (jquery-1.12.3.min.js?v=1531811705531:2)
at Object.add [as done] (jquery-1.12.3.min.js?v=1531811705531:2)
What's the issue?

Jhipster-generator error on production profile

I'm Trying to run my app in production profile, i'm using jhipster-generator for spring-boot app and angular. The app only run the footer and the background but the rest of the aplication nope, The error
Uncaught Error: [$injector:modulerr] Failed to instantiate module myAppdue to:
Error: [$injector:nomod] Module 'myApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
http://errors.angularjs.org/1.5.8/$injector/nomod?p0=myApp
at http://localhost:8080/app/vendor-7004bf12ca.js:8:17716
at http://localhost:8080/app/vendor-7004bf12ca.js:8:27870
at n (http://localhost:8080/app/vendor-7004bf12ca.js:8:27343)
at http://localhost:8080/app/vendor-7004bf12ca.js:8:27655
at http://localhost:8080/app/vendor-7004bf12ca.js:9:4997
at r (http://localhost:8080/app/vendor-7004bf12ca.js:8:18164)
at f (http://localhost:8080/app/vendor-7004bf12ca.js:9:4845)
at rt (http://localhost:8080/app/vendor-7004bf12ca.js:9:6774)
at a (http://localhost:8080/app/vendor-7004bf12ca.js:8:25413)
at ie (http://localhost:8080/app/vendor-7004bf12ca.js:8:25723)
http://errors.angularjs.org/1.5.8/$injector/modulerr?p0=myApp&p1=Error%3A%20%5B%24injector%3Anomod%5D%20Module%20'myApp'%20is%20not%20available!%20You%20either%20misspelled%20the%20module%20name%20or%20forgot%20to%20load%20it.%20If%20registering%20a%20module%20ensure%20that%20you%20specify%20the%20dependencies%20as%20the%20second%20argument.%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.5.8%2F%24injector%2Fnomod%3Fp0%3DdigitalBlogApp%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A8%3A17716%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A8%3A27870%0A%20%20%20%20at%20n%20(http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A8%3A27343)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A8%3A27655%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A9%3A4997%0A%20%20%20%20at%20r%20(http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A8%3A18164)%0A%20%20%20%20at%20f%20(http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A9%3A4845)%0A%20%20%20%20at%20rt%20(http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A9%3A6774)%0A%20%20%20%20at%20a%20(http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A8%3A25413)%0A%20%20%20%20at%20ie%20(http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A8%3A25723)
at http://localhost:8080/app/vendor-7004bf12ca.js:8:17716
at http://localhost:8080/app/vendor-7004bf12ca.js:8:27870
at n (http://localhost:8080/app/vendor-7004bf12ca.js:8:27343)
at http://localhost:8080/app/vendor-7004bf12ca.js:8:27655
at http://localhost:8080/app/vendor-7004bf12ca.js:9:4997
at r (http://localhost:8080/app/vendor-7004bf12ca.js:8:18164)
at f (http://localhost:8080/app/vendor-7004bf12ca.js:9:4845)
at rt (http://localhost:8080/app/vendor-7004bf12ca.js:9:6774)
at a (http://localhost:8080/app/vendor-7004bf12ca.js:8:25413)
at ie (http://localhost:8080/app/vendor-7004bf12ca.js:8:25723)
http://errors.angularjs.org/1.5.8/$injector/modulerr?p0=myApp&p1=Error%3A%20%5B%24injector%3Anomod%5D%20Module%20'myApp'%20is%20not%20available!%20You%20either%20misspelled%20the%20module%20name%20or%20forgot%20to%20load%20it.%20If%20registering%20a%20module%20ensure%20that%20you%20specify%20the%20dependencies%20as%20the%20second%20argument.%0Ahttp%3A%2F%2Ferrors.angularjs.org%2F1.5.8%2F%24injector%2Fnomod%3Fp0%3DdigitalBlogApp%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A8%3A17716%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A8%3A27870%0A%20%20%20%20at%20n%20(http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A8%3A27343)%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A8%3A27655%0A%20%20%20%20at%20http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A9%3A4997%0A%20%20%20%20at%20r%20(http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A8%3A18164)%0A%20%20%20%20at%20f%20(http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A9%3A4845)%0A%20%20%20%20at%20rt%20(http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A9%3A6774)%0A%20%20%20%20at%20a%20(http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A8%3A25413)%0A%20%20%20%20at%20ie%20(http%3A%2F%2Flocalhost%3A8080%2Fapp%2Fvendor-7004bf12ca.js%3A8%3A25723)
at http://localhost:8080/app/vendor-7004bf12ca.js:8:17716
at http://localhost:8080/app/vendor-7004bf12ca.js:9:5273
at r (http://localhost:8080/app/vendor-7004bf12ca.js:8:18164)
at f (http://localhost:8080/app/vendor-7004bf12ca.js:9:4845)
at rt (http://localhost:8080/app/vendor-7004bf12ca.js:9:6774)
at a (http://localhost:8080/app/vendor-7004bf12ca.js:8:25413)
at ie (http://localhost:8080/app/vendor-7004bf12ca.js:8:25723)
at re (http://localhost:8080/app/vendor-7004bf12ca.js:8:24962)
at HTMLDocument.<anonymous> (http://localhost:8080/app/vendor-7004bf12ca.js:13:25627)
at p (http://localhost:8080/app/vendor-7004bf12ca.js:2:8692)
what can it be ?
It is probably due to something you changed in index.html because JHipster uses gulp to inject scripts and css into it when building for production. Compare your current version with the one you archived in git at project generation time.

angular_1.default.module Uncaught TypeError: Cannot read property 'module' of undefined

I am creating a starter template using angular 1.6, webpack, gulp and typescript. I am able to compile and build my application but app is not bootstrapping. The issue is weird as when I am debugging angular.module is defined and module can be created from console angular.module('testModule', []) but as resume debugger I get exception in core.module.ts at export const CoreModule = angular.module('app.core', []).name;.
I have further investigated this issue by disabling source code and I have found the problem. The above mentioned code compiles to exports.CoreModule = angular_1.default.module('app.core', []).name; where there is no property named default on angular_1.
For code refer https://github.com/muditsaurabh/awesome-ng-starter
Uncaught TypeError: Cannot read property 'module' of undefined
at Object.<anonymous> (app.bundle.js?cd4d443…:1)
at e (vendor.bundle.js?cd4d443…:1)
at Object.<anonymous> (app.bundle.js?cd4d443…:1)
at e (vendor.bundle.js?cd4d443…:1)
at Object.<anonymous> (app.bundle.js?cd4d443…:1)
at e (vendor.bundle.js?cd4d443…:1)
at window.webpackJsonp (vendor.bundle.js?cd4d443…:1)
at app.bundle.js?cd4d443…:1
vendor.bundle.js?cd4d443…:6Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to:
Error: [$injector:nomod] Module 'app' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
http://errors.angularjs.org/1.6.1/$injector/nomod?p0=app
at http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:377
at http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:11230
at n (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:10668)
at http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:11004
at http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:20796
at r (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:809)
at h (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:20644)
at le (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:22631)
at a (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:8560)
at st (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:8870)
http://errors.angularjs.org/1.6.1/$injector/modulerr?p0=app&p1=Error%3A%20%…2F%2Flocalhost%3A8000%2Fvendor.bundle.js%3Fcd4d4432605c6f5be56a%3A6%3A8870)
at http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:377
at http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:11230
at n (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:10668)
at http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:11004
at http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:20796
at r (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:809)
at h (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:20644)
at le (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:22631)
at a (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:8560)
at st (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:8870)
http://errors.angularjs.org/1.6.1/$injector/modulerr?p0=app&p1=Error%3A%20%…2F%2Flocalhost%3A8000%2Fvendor.bundle.js%3Fcd4d4432605c6f5be56a%3A6%3A8870)
at http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:377
at http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:21073
at r (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:809)
at h (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:20644)
at le (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:22631)
at a (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:8560)
at st (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:8870)
at at (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:8109)
at http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:11:13916
at HTMLDocument.n (http://localhost:8000/vendor.bundle.js?cd4d4432605c6f5be56a:6:17809)
I have replaced import angular from 'angular' with import * as angular from 'angular' and now it is working fine.
Are you sure that AngularJS gets included before your script? The error means that the object angular hasn't been seen by Javascript yet and therefore module cannot be called on it.
You can also just add
"esModuleInterop": true,
to your tsconfig.json instead of using a star import everywhere.

Parsley js remote config. Error browser dev console

I followed the Custom remote validators documentation
I have <script href="parsley.remote.js"></script> before <script href="parsley.js"></script> just before the end of html body and I'm seeing the following message on the console of Chrome Developer Tools:
Uncaught TypeError: Cannot read property 'on' of undefined(anonymous function) # parsley.remote.js:267(anonymous function) # parsley.remote.js:271
Part of paryley.remote.js code :
window.Parsley.on('form:submit', function () {
this._remoteCache = {};
});
On Firebug the error console message is
TypeError: window.Parsley is undefined
window.Parsley.on('form:submit', function () {
A small lab just a test html page with source dist js parsley
If I invert file reference parsley.remote.js and parsley.js, the error disappears, but according to the documentation, it's not the right way.
It's was bug, fixed in 2.1.3+.
Only include the remote version (assuming you need it).

Application.js get cleaned up when building project with Visual Studio

I have download the sample https://github.com/tastejs/todomvc/tree/master/examples/typescript-angular and I try to get it working under a VS2013 Web Application empty template.
I add all the file of the sample, I launch the website by IIS, it works fine.
But when I build the project (without modifying anything) the only lines that remain are :
/// <reference path='_all.ts' />
/**
* The main TodoMVC app module.
*
* #type {angular.Module}
*/
var todos;
(function (todos) {
'use strict';
var todomvc = angular.module('todomvc', []).controller('todoCtrl', todos.TodoCtrl).directive('todoBlur', todos.todoBlur).directive('todoFocus', todos.todoFocus).service('todoStorage', todos.TodoStorage);
})(todos || (todos = {}));
When I try to run the website I have the following error :
http://localhost/WebAppTodoMvc/bower_components/angular/angular.js
0x800a139e - Erreur d’exécution JavaScript: [$injector:modulerr] Failed to instantiate module todomvc due to
Error: [ng:areq] Argument 'directiveFactory' is required
That code is meant to work with the --out compiler flag and you should use _all.js generated from all.ts https://github.com/tastejs/todomvc/blob/master/examples/typescript-angular/js/_all.ts
You can specify this as the reference file from your project properties.

Resources