Including Angular-UI-Validate in my project - javascript

The project uses Angular 1.3 (from a CDN, links removed below) and I'm trying to install Angular-UI-Validate. I have included both in script tags, and in the inspector, I can see that they're both getting retrieved correctly. Still, it seems as if I'm missing something:
Error: [$injector:unpr] http://errors.angularjs.org/1.3.10/$injector/unpr?p0=ui.validateProvider%20%3C-%20ui.validate%20%3C-%20app.runtimeStackAdminController
at Error (native)
at https://***.cdn.net/1.5/libs/angular.js/1.3.10/angular.min.js:6:417
at https://***.cdn.net/1.5/libs/angular.js/1.3.10/angular.min.js:38:307
at Object.d [as get] (https://***.cdn.net/1.5/libs/angular.js/1.3.10/angular.min.js:36:308)
at https://***.cdn.net/1.5/libs/angular.js/1.3.10/angular.min.js:38:381
at d (https://***.cdn.net/1.5/libs/angular.js/1.3.10/angular.min.js:36:308)
at e (https://***.cdn.net/1.5/libs/angular.js/1.3.10/angular.min.js:37:64)
at Object.g.instantiate (https://l***.cdn.net/1.5/libs/angular.js/1.3.10/angular.min.js:37:213)
at b.$get (https://***.cdn.net/1.5/libs/angular.js/1.3.10/angular.min.js:76:318)
at $route.link (https://***.cdn.net/1.5/libs/angular.js/1.3.10/angular-route.js:981:26) <div id="ng-view-wrapper" class="container-fluid ng-scope" ng-view="" autoscroll="true">
Am I missing a library that I have to include? Thanks in advance!

You need to load the ui.validate module.
See https://github.com/angular-ui/ui-validate#usage for all instructions.

Related

Issues with Ionic2, Angular2 mobile application

Iam trying to run a ionic2,angular2 application as per this github link using command ionic serve --lab
https://github.com/chsakell/ionic2-angular2-firebase/issues
Iam getting following error message
TypeError: Cannot read properties of undefined (reading 'annotations')
at ReflectionCapabilities.annotations (http://localhost:8100/build/vendor.js:18711:24)
at Reflector.annotations (http://localhost:8100/build/vendor.js:18829:44)
at NgModuleResolver.resolve (http://localhost:8100/build/vendor.js:15969:44)
at CompileMetadataResolver.getNgModuleMetadata (http://localhost:8100/build/vendor.js:15226:47)
at RuntimeCompiler._compileComponents (http://localhost:8100/build/vendor.js:26691:47)
at RuntimeCompiler.compileModuleAndComponents (http://localhost:8100/build/vendor.js:26629:37)
at RuntimeCompiler.compileModuleAsync (http://localhost:8100/build/vendor.js:26620:21)
at PlatformRef.bootstrapModuleWithZone (http://localhost:8100/build/vendor.js:11187:25)
at PlatformRef.bootstrapModule (http://localhost:8100/build/vendor.js:11169:21)
at Object.176 (http://localhost:8100/build/main.js:30:109)
When I lookup vendor.js it is this line
if (typeOrFunc.annotations) {
I dont know where typeOrFunc is defined..
Any help or pointers pls..Thanks in advance

Uncaught Error: Graph container element not found

I saw answer "JavaScript's code gets executed before the DOM contains #annual element. Put the javascript after the div or use jQuery.ready()" But I don't know to put after what div?
<script src="/bower_components/morris.js/morris.min.js"></script> this is script include?
enter image description here
error:
Uncaught Error: Graph container element not found
at d [as constructor] (morris.min.js:6)
at d.c [as constructor] (morris.min.js:6)
at new d (morris.min.js:6)
at HTMLDocument.<anonymous> (dashboard.js:129)
at j (jquery.min.js:2)
at k (jquery.min.js:2)
If you are using adminLte template in an angular project, you have to delete the import dashboard.js from the scripts array in angular.json file.
i confirm resolution :
im using AdminLTE in angular :
delete the import dashboard.js from the scripts array in angular.json file.

Error in minifed version of controller - angularjs?

I am working on angularjs and node.js.
Problem:
I am getting following error in minified version of controller(Angular Controller js file). But it is working in the normal version.
Error:
Error: [$injector:unpr] http://errors.angularjs.org/1.2.25/$injector/unpr?p0=eProvider%20%3C-%20e
at Error (native)
at http://localhost:8080/assets/lib/js/angularjs/angular.min.js:6:450
at http://localhost:8080/assets/lib/js/angularjs/angular.min.js:36:202
at Object.c [as get] (http://localhost:8080/assets/lib/js/angularjs/angular.min.js:34:305)
at http://localhost:8080/assets/lib/js/angularjs/angular.min.js:36:270
at c (http://localhost:8080/assets/lib/js/angularjs/angular.min.js:34:305)
at d (http://localhost:8080/assets/lib/js/angularjs/angular.min.js:35:6)
at Object.instantiate (http://localhost:8080/assets/lib/js/angularjs/angular.min.js:35:165)
at http://localhost:8080/assets/lib/js/angularjs/angular.min.js:67:419
at link (http://localhost:8080/assets/lib/js/angularjs/angular-route.js:907:26) <div ng-view="" class="ng-scope">
I am using gulp-uglify to minify the controller
Code
gulp.task('buildControllerScript', function(){
return gulp.src(paths.controllers)
.pipe(concat('controllers.js'))
.pipe(gulp.dest('./public/dist/controllers/'))
.pipe(rename('controllers.min.js'))
.pipe(uglify())
.pipe(gulp.dest('./public/dist/controllers/'));
});
Note:
Seems to be something wrong while uglify.
I cannot expose the controller code due to privacy rules
Any suggestion will be grateful.
Since Angular's dependency injection depends on the names of your function parameters, you either need to use dependency annotation or replace the uglify gulp plugin with gulp-ng-annotate.

Angular JS Karma module not found

I get an error message -"ReferenceError: module is not defined" when trying to test angular js code.
test script [testSpec.js]
describe('Project controllers', function() {
beforeEach(module('project'));
describe('ListCtrl', function() {
expect(1).toBe(1);
});
});
I have the following entries in my html file
<script src="angular.min.js"></script>
<script src="angular-resource.min.js"></script>
<script src="angular-mocks.js"></script>
followed by my test script - testSpec.js
I specifically included angular.js and angular-mocks.js again. I get to see the following error message
Chrome 31.0.1650 (Windows 7) Project controllers ListCtrl should create 11 records FAILED
TypeError: Object #<Object> has no method 'apply'
Error: Unknown provider: ProjectsProvider <- Projects
at Error (<anonymous>)
at c:/Angular/angular-phonecat/app/angular.min.js:30:24
at Object.c [as get] (c:/Angular/angular-phonecat/app/angular.min.js:27:310)
at c:/Angular/angular-phonecat/app/angular.min.js:30:109
at c (c:/Angular/angular-phonecat/app/angular.min.js:27:310)
at d (c:/Angular/angular-phonecat/app/angular.min.js:27:444)
at Object.instantiate (c:/Angular/angular-phonecat/app/angular.min.js:29:80)
at c:/Angular/angular-phonecat/app/angular.min.js:53:80
at null.<anonymous> (c:/Angular/angular-phonecat/app/testSpec.js:10:12)
at Object.d [as invoke] (c:/Angular/angular-phonecat/app/angular.min.js:28:464)
Error: Declaration Location
at window.jasmine.window.inject.angular.mock.inject (c:/Angular/angular-phonecat/app/angular-mocks.js:1781:2
Here is the complete error
5) at null.<anonymous> (c:/Angular/angular-phonecat/app/testSpec.js:8:34)\n
at null.<anonymous> (c:/Angular/angular-phonecat/app/testSpec.js:6:2)\n
at c:/Angular/angular-phonecat/app/testSpec.js:2:1
Chrome 31.0.1650 (Windows 7) Project controllers ListCtrl should contain new fields FAILED
TypeError: Object #<Object> has no method 'apply'
Error: Unknown provider: ProjectsProvider <- Projects
I'm suspecting that you're missing some include files in you karma config file. Specifically, make sure you load angular.js.
Did you include angular-mocks.js ?
That should solve your problem.
You need that for it to work.

RequireJS Optimization Reference Error

I am using RequireJS to organise my JS files. I am attempting optimize my files into one main JS file.
I am using the following command to do this:
/home/plugins/requireJS/build/build.sh name=main out=mesh-built.js baseUrl=/home/public_html/js/ includeRequire=true
The command produces the following error:
Tracing dependencies for: main
node.js:116
throw e; // process.nextTick error, or 'error' event on first tick
^
ReferenceError: $ is not defined
at eval at <anonymous> (/home/plugins/requireJS/bin/../build/jslib/requirePatch.js:147:21)
at Function.<anonymous> (eval at <anonymous> (/home/plugins/requireJS/bin/../build/jslib/requirePatch.js:147:21))
at Function.load (/home/plugins/requireJS/bin/../build/jslib/requirePatch.js:147:21)
at loadPaused (require.js:916:21)
at require.js:958:21
at Object.completeLoad (require.js:1207:17)
at Function.load (/home/plugins/requireJS/bin/../build/jslib/requirePatch.js:150:29)
at loadPaused (require.js:916:21)
at require.js:958:21
at Object.completeLoad (require.js:1207:17)
Does anyone know why it would be producing this error?
Many thanks.
I think its a problem with the order of the files to include. Make sure the JS file which defines the $() is included first.

Categories

Resources