angular-schema-form doesn't build and no error - angular-schema-form

I'm trying to build a simple test app with angular-schema-form with no success.
{
"name": "schema form test",
"private": true,
"dependencies": {
"angular": "^1.3.x",
"angular-route": "1.3.x",
"angular-schema-form": "0.7.3",
"tv4": "~1.0.15",
"angular-sanitize": ">= 1.2",
"objectpath": "~1.0.4",
"jquery": "~2.1.x",
"jquery-ui": "~1.11.x"
},
"resolutions": {
"angular": "^1.3.x"
}
}
Then the code is actually a copy-paste of example from https://github.com/Textalk/angular-schema-form and it doesn't work. Does anybody see any problems with versions above?

Actually nothing wrong with versions here. It's just stupid me, who didn't put 'schemaForm' in requires when calling angular.module.

Related

fixing version problems in bower after installing Angular Material

I have a project which was using angular version 1.4. I installed angular material via bower and then subsequently received the following error:
Uncaught TypeError: angular.module(...).info is not a function
I read this was to do with the version of angular I'm using so I updated angular and then angular-animate to 1.6. However this didn't fix the problem. I tried running bower update but I still have the above error.
When I ran bower update I received the following warning...
Resort to using angular#~1.4.2 which resolved to angular#1.4.14
Code incompatibilities may occur.
this is the contents of my bower.json file:
{
"name": "node-template",
"version": "0.0.0",
"main": [
"./public/styles/*.css",
"./public/scripts/*.js"
],
"dependencies": {
"angular-animate": "1.6",
"angular-sanitize": "~1.4.2",
"angular-messages": "~1.4.2",
"bootstrap-sass": "~3.3.5",
"jquery": "~2.1.4",
"angular": "1.6",
"angular-ui-router": "~0.2.15",
"angular-bootstrap": "~2.5.0",
"angular-google-chart": "~0.1.0",
"velocity": "~1.4.2",
"animate.css": "~3.5.2",
"angular-file-saver": "~1.1.3",
"ng-file-upload": "~12.2.13",
"ng-img-crop": "ngImgCrop#~0.3.2",
"angularfire": "~2.3.0",
"angular-material": "~1.1.4"
},
"devDependencies": {
"angular-mocks": "~1.4.2"
},
"overrides": {},
"resolutions": {
"jquery": "~2.1.4",
"angular": "~1.4.2"
}
}
Is bower telling me I'm using version 1.4? I don't understand why it cannot resolve the version problems I'm encountering?
Edit:
here is my new bower.json after upgrading to angular 1.5:
{
"name": "node-template",
"version": "0.0.0",
"main": [
"./public/styles/*.css",
"./public/scripts/*.js"
],
"dependencies": {
"angular-animate": "1.4",
"angular-sanitize": "~1.4.2",
"angular-messages": "~1.4.2",
"bootstrap-sass": "~3.3.5",
"jquery": "~2.1.4",
"angular": "1.5",
"angular-ui-router": "~0.2.15",
"angular-bootstrap": "~2.5.0",
"angular-google-chart": "~0.1.0",
"velocity": "~1.4.2",
"animate.css": "~3.5.2",
"angular-file-saver": "~1.1.3",
"ng-file-upload": "~12.2.13",
"ng-img-crop": "ngImgCrop#~0.3.2",
"angularfire": "~2.3.0",
"angular-material": "~1.1.4"
},
"devDependencies": {
"angular-mocks": "~1.4.2"
},
"overrides": {},
"resolutions": {
"jquery": "~2.1.4",
"angular": "1.5"
}
}
You have Angular 1.4.14 installed. Looking at the bower.json for Angular Material the minimum version of AngularJS required for the package is 1.5 which is probably why you are having errors. Can you not update to AngularJS 1.5?
Failing that, I suggest you install an older version of Angular Material that is compatible with 1.4.x
The error I was seeing...
angular.module(...).info is not a function
...seems to arise when the version of angular-aria (required by angular-material) is newer than the version of angular. I managed to get my build working again by setting angular-aria to be the same version as angular.

ngStorage module not found only in gulp dist:serve?

I strike this error one again, last time I have fixed but do not know how this fixed but again it occurs.
I have ngstorage module installed and projecr run fine when it's in development ( gulp clean serve ) BUT when it goes to production ( gulp serve:dist) , it execute well but main page is blank and there is error in console
Uncaught Error: [$injector:modulerr] Failed to instantiate module app
due to: Error: [$injector:modulerr] Failed to instantiate module
ngStorage due to: Error: [$injector:nomod] Module 'ngStorage' 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=ngStorage
although I have checked that it's installed can somebody can suggest what is the issue and how to fix this? here is my bower.json
{
"name": "project",
"version": "0.1.1",
"dependencies": {
"angular-animate": "1.5.8",
"angular-touch": "~1.5.0",
"angular-sanitize": "~1.5.0",
"angular-messages": "~1.5.0",
"angular-aria": "~1.5.0",
"jquery": "~2.1.4",
"angular-resource": "~1.5.0",
"angular-ui-router": "~0.2.15",
"bootstrap": "~3.3.6",
"angular-bootstrap": "~1.1.2",
"angular-toastr": "~2.0.0",
"moment": "~2.13.0",
"animate.css": "~3.4.0",
"angular": "~1.5.0",
"ng-table": "^1.0.0",
"pace": "~1.0.2",
"metisMenu": "~2.0.2",
"fontawesome": "~4.5.0",
"roboto-fontface": "^0.7.0",
"angular-ui-validate": "^1.2.2",
"ng-stomp": "^0.2.0",
"angular-scrollable-table": "^1.1.1",
"aws-sdk": "aws-sdk-js#^2.7.7",
"ng-file-upload": "^12.2.13",
"angular-recaptcha": "^4.0.3",
"ng-csv": "^0.3.6",
"ngstorage": "^0.3.11",
"intl-tel-input": "5.1.7",
"international-phone-number": "^0.0.16",
"angular-chart.js": "^1.1.1"
},
"devDependencies": {
"angular-mocks": "1.5.8"
},
"overrides": {
"bootstrap": {
"main": [
"less/bootstrap.less",
"dist/fonts/glyphicons-halflings-regular.eot",
"dist/fonts/glyphicons-halflings-regular.svg",
"dist/fonts/glyphicons-halflings-regular.ttf",
"dist/fonts/glyphicons-halflings-regular.woff",
"dist/fonts/glyphicons-halflings-regular.woff2"
]
},
"fontawesome": {
"main": [
"less/font-awesome.less",
"fonts/fontawesome-webfont.eot",
"fonts/fontawesome-webfont.svg",
"fonts/fontawesome-webfont.ttf",
"fonts/fontawesome-webfont.woff",
"fonts/fontawesome-webfont.woff2"
]
},
"roboto-fontface": {
"main": [
"css/roboto/less/roboto-fontface.less"
]
},
"chart.js": {
"main": [
"dist/Chart.bundle.min.js"
]
}
},
"resolutions": {
"jquery": "~2.1.4",
"angular": "1.5.8"
},
"description": "Project Manager On-Premise",
"main": "",
"homepage": "index.html",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
]
}
I think there is issue related to stmop or I am using broswer-sync , that may be cause but cant be sure.
see the
Issue was dues to one of library --which is included-- missing semicolon in it's main js file
cause:
I was using ng-stomp in my project and installed this library using bower install and when I run gulp dist:serve it minified all the files which are mentioned in the main bower.json file and it read bower_components/ng-stomp/package.json where main file location was "main": "src/ng-stomp.js" and this file missing semicolon in the end so when next js library ( ngStorage) is minified, it does not recognize by it's parser and it throws error.
solution:
override the main file by writing below code in my bower.json overrides block ( add the ng-stomp.min.js which has semicolon in end)
"ng-stomp": {
"main": [
"dist/ng-stmop.min.js"
]
}
hope it helps someone

angular (1.5.8-build.4928+sha.e8c2e11) - wrong version

I am trying to install angular 1.4.5 using bower.json. This is how my bower.json file looks like
{
"name": "asp.net",
"private": true,
"dependencies": {
"angular": "1.4.5",
"angular-resource": "1.4.5",
"angular-route": "1.4.5",
"bootstrap": "3.3.5"
}
}
after saving, this file got changed to
{
"name": "asp.net",
"private": true,
"dependencies": {
"angular": "1.4.5",
"angular-resource": "1.4.5",
"angular-route": "1.4.5",
"bootstrap": "3.3.5"
},
"resolutions": {
"angular": "1.5.8-build.4928+sha.e8c2e11"
}
}
and i guess because of this, angular is not installing, it says wrong version.
check under Bower folder
any assistance would be greatly appreciated.
use ~ sign in "angular": "~1.4.x"
{
"name": "asp.net",
"private": true,
"dependencies": {
"angular": "~1.4.x",
"angular-resource": "1.4.5",
"angular-route": "1.4.5",
"bootstrap": "3.3.5"
}
}
for more information read this
https://github.com/angular/angular.js/issues
It will be better use this also. Add new issue and you will definitely find something. I never got this kind of problem anytime when I was installing or doing anything with AngularJS.
Thanks
Add below resolution and delete Bower folder.
"resolutions": {
"angular": "1.4.5"
}
This will install v1.4.5 of angular
I hope this helps you
Cheers!

Why do my project modules have the wrong versions?

I'm building an AngularJS application. Everything is working fine but I discover that if I clone the repository for a clear new installation ALL the version of the module in /bower_components and /node_modules are different.
Some examples:
brand new cloned repository:
{
"name": "angular-animate",
"version": "1.5.7",
"license": "MIT",
"main": "./angular-animate.js",
"ignore": [],
"dependencies": {
"angular": "1.5.7"
}
}
Old repository:
{
"name": "angular-animate",
"version": "1.5.6",
"license": "MIT",
"main": "./angular-animate.js",
"ignore": [],
"dependencies": {
"angular": "1.5.6"
}
}
Even AngularJS itself:
New repository:
* #license AngularJS v1.4.12
Old repository:
* #license AngularJS v1.4.10
That is happening for EVERY file in those two folders. How can I save all the current version of the bower and node modules and push that versions on my repository so everything would be okay for a fresh new installation?
EDIT:
This is my current bower.json file. What should I change in order to get specific versions of all AngularJS modules?
{
"name": "angular-seed",
"description": "A starter project for AngularJS",
"version": "0.0.0",
"homepage": "https://github.com/angular/angular-seed",
"license": "MIT",
"private": true,
"dependencies": {
"angular": "~1.4.0",
"angular-route": "~1.4.0",
"angular-loader": "~1.4.0",
"angular-mocks": "~1.4.0",
"html5-boilerplate": "~5.2.0",
"angular-payments": "*",
"jquery": "^2.2.3",
"webcam": "webcam-directive#^3.1.1",
"angularjs-slider": "^2.14.0",
"a0-angular-storage": "^0.0.15",
"angular-animate": "^1.5.6"
}
}
Replacing:
"angular": "~1.4.0",
With:
"angular": "1.5.6",
Will keep version 1.5.6 even if a newer version is available
Using the tilde ("~1.4.0") indicates you'll take any subsequent patch-level changes on the 1.4.x tree, starting with 1.4.0, but less than 1.5.0. To specify an exact version, simply remove the tilde and use the specific version number.
Instead of:
"angular": "~1.4.0"
Do this:
"angular": "1.4.10"

AngularJS application deployment to Heroku, unable to find suitable angular-animate version

I am deploying an AngularJS application to Heroku but am getting this error in the console:
remote: bower ECONFLICT Unable to find suitable version for angular-animate
remote:
remote: ! Push rejected, failed to compile Node.js app
remote:
remote: Verifying deploy....
remote:
remote: ! Push rejected to test-app-12345
The problem (of course) seems to be with the angular-animate dependency.
I am using a Heroku angularJS buildpack "Yo Angular" and have followed their 4 step process for a successful application deployment to Heroku.
I tried fixing this by changing my bower.json file like recommended in this StackOverflow answer, hoping it would solve my issue. It did not.
Locally, I use grunt serve to start the application and that works for me just fine.
My bower.json looks like this:
{
"name": "dashboard",
"version": "0.0.0",
"main": "index.html",
"ignore": [
"**/.*",
"node_modules",
"bower_components"
],
"dependencies": {
"jquery": "~2.0",
"bootstrap": "~3.1.1",
"angular": "~1.3.15",
"angular-ui-router": "~0.2",
"angular-animate": "~1.3.15",
"angular-resource": "~1.3.15",
"angular-cookies": "~1.3.15",
"angular-mocks": "~1.3.15",
"angular-ui-utils": "~0.1",
"angular-bootstrap": "~0.11.2",
"moment": "~2.5",
"less.js": "~1.6",
"font-awesome": "~4.2.0",
"form-builder": "0.1.0",
"restangular": "~1.4.0",
"lodash": "~2.4.1",
"satellizer": "~0.3.2",
"angular-xeditable": "~0.1.8",
"fullcalendar": "~2.1.1",
"angular-ui-calendar": "~0.8.1",
"checklist-model": "~0.1.3"
},
"resolutions": {
"font-awesome": "~4.2.0",
"jquery": "~2.0",
"fullcalendar": "~2.1.1",
"angular": "~1.3.15",
"angular-bootstrap": "~0.11.2"
}
}
The code is public for now, so here is the link to the Github repo.
Anyone have tips for me, or a good idea of what I am doing wrong?
P.S. I found this information in bower's Github issues tracking, which is dealing with the same problem. Might be helpful in figuring this out.
This error occurs when two packages reference different versions of the same dependency.
You can resolve the issue by running rm -rf bower_components/ ; bower install
Then when prompted to choose a version prefix your answer with a "!" like I have below. Notice how bower will add a "resolutions" section.
Unable to find a suitable version for angular-animate, please choose one:
1) angular-animate#~1.2 which resolved to 1.2.28 and is required by form-builder#0.1.0
2) angular-animate#~1.3.15 which resolved to 1.3.17 and is required by dashboard
3) angular-animate#~1.4.3 which resolved to 1.4.3
Prefix the choice with ! to persist it to bower.json
? Answer: !3
Here is your resolved bower.json file.
{
"name": "dashboard",
"version": "0.0.0",
"main": "index.html",
"ignore": [
"**/.*",
"node_modules",
"bower_components"
],
"dependencies": {
"jquery": "~2.0",
"bootstrap": "~3.1.1",
"angular": "~1.3.15",
"angular-ui-router": "~0.2",
"angular-animate": "~1.4.3",
"angular-resource": "~1.3.15",
"angular-cookies": "~1.3.15",
"angular-mocks": "~1.3.15",
"angular-ui-utils": "~0.1",
"angular-bootstrap": "~0.11.2",
"moment": "~2.5",
"less.js": "~1.6",
"font-awesome": "~4.2.0",
"form-builder": "0.1.0",
"restangular": "~1.4.0",
"lodash": "~2.4.1",
"satellizer": "~0.3.2",
"angular-xeditable": "~0.1.8",
"fullcalendar": "~2.1.1",
"angular-ui-calendar": "~0.8.1",
"checklist-model": "~0.1.3"
},
"resolutions": {
"font-awesome": "~4.2.0",
"jquery": "~2.0",
"fullcalendar": "~2.1.1",
"angular": "~1.3.15",
"angular-bootstrap": "~0.11.2",
"angular-animate": "~1.4.3"
}
}

Resources