Angularjs failed to instantiate module thitch ’angular-file-saver’ - javascript

How to right add angular-file-saver in AngularJS project?
I trying to implement: angular-file-saver (FileSaver.js version for Angularjs) But it's not working.
1) installing filesaver file upload via bower with the command:
bower install angular-file-saver --save
2) I am trying to addition FileSaver.js module in app.js , but in browser console after starting have error:
window.mmvvtApp = angular.module('mmvvt', ['ngBootstrap', 'ngFileSaver',...
Failed to instantiate module mmvvt due to:
Error: [$injector:modulerr] http://errors.angularjs.org/1.2.26/$injector/modulerr?p0=...)
If i remove the 'ngFileSaver' from function then I am not facing the issue but when I put it in the function legislator and try to call it I get the issue.
May be non compatible versions: AngularJS#1.2.26 and angular-file-saver#1.1.3 don’t work together ?
Can someone help me please?
Thank you.

Earned after include in file "WEB-INF/jsp/main.jsp" next code:
<script src="bower_components/angular-file-saver/dist/angular-file-saver.bundle.js"></script>
AngularJS#1.2.26 and angular-file-saver#1.1.3 work together correctly.

Related

Error when update #adonisjs/ally version 2.1.3 to 4.1.3

After I updated #adonisjs/ally version from 2.1.3 to 4.1.3 and then I got error Cannot find module 'Model. I comment AllyProvider line and run again, It's not error but I can't login both facebook and google. I'm not sure, I do something wrong. (I use adonis 4.1.0) Thank for your suggestion. I spend many time for update adonisjs ally version to 4.1.3
An error that I got.
I comment access provider ally in app.js
In my package.json
Check in the folder "node_modules" > "ally" if there is a folder "providers", if not, check if there is a folder "build" and check if inside it there is a folder "provider" and inside the file "AllyProvider.js" .
After confirming this folder structure, just change the code in "start/app.js" inside "const providers = {...}"
from: '#adonisjs/ally/providers/AllyProvider'
to: '#adonisjs/ally/build/providers/AllyProvider',
If it doesn't work, I advise you to remove the package and install it on version 2.1.3 which will work correctly with this configuration: '#adonisjs/ally/providers/AllyProvider'

Vuetify SASS not compiling correctly with Nuxt

I wanna make Vuetify work with Nuxt via Plugin but get the problem of :
Textform:
ERROR in ./node_modules/vuetify/src/components/VProgressLinear/VProgressLinear.sass friendly-errors 21:22:30
Module build failed (from ./node_modules/sass-loader/lib/loader.js): friendly-errors 21:22:30
undefined
^
Invalid CSS after " #content": expected "}", was "($material-light); "
I installed all the necessary Sass Loaders according to Vuetify and Nuxt´s Docs. I set up a Example Repository barebone to recreate the problem. https://github.com/Badgyy/vdling
Sitting on the problem for hours now but didn´t find any suitable solution online, I appreciate any help.
Its because you are using node-sass, while you should be using sass.
Also, I suggest just to use nuxtjs/vuetify module, that will install all deps correctly and do all needed configuration

Module 'smart-table' is not available

I am trying to get started with a smart-table. I am following the instructions available here: http://lorenzofox3.github.io/smart-table-website/
So according to those instructions all I need to do is run, bower install angular-smart-table and then add then add the module angular.module('myApp',['smart-table'] to your angular application. Here's my angular application:
# pwd
/var/www/html
# cat meanVoyApp.js
var app = angular.module("meanVoyApp", ['smart-table']);
But now when I load my markup I get these errors in my browsers console:
Uncaught Error: [$injector:modulerr] Failed to instantiate module meanVoyApp due to:
Error: [$injector:modulerr] Failed to instantiate module smart-table due to:
Error: [$injector:nomod] Module 'smart-table' 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.3.14/$injector/nomod?p0=smart-table
I didn't misspell so I guess I "forgot" to load it. So how do I load it? How can I tell if it is already loaded and something else is the problem?
Thanks!
Did you remember to add a reference to the script in your index.html?
<script src="[directoryOfModule]/smart-table.js"></script>
Smart-table comes with some js file. I think you are not loading that before to your meanVoyApp.js load. Use chrome developer tool network panel to identify the java-script are properly loaded nor not.
Use the following code before your app.js load
<script src="http://lorenzofox3.github.io/smart-table-website/bower_components/angular-smart-table/dist/smart-table.js"></script>
Use
bower install angular-smart-table --save
and some good gulp or grunt build tool configuration (e.g. yeoman) will automatically add it to your index.html.
Take a look at your build process.
In case you use ngBoilerplate kickstarter, you need to add the following line:
'vendor/angular-smart-table/dist/smart-table.min.js'
inside vendor_files section of build.config.js file.

cannot find module breeze with browserify

I am attempting to load breeze using browserify. I used npm to install the breeze-client library. If I run browserify without including breeze everything runs fine, but when I include breeze I get the following error:
Error: Cannot find module 'breeze' from 'C:\...\node_modules\breeze-client'
I've tried doing the require every way I can think of
require("breeze-client");
require("breeze-client/breeze.debug");
require("breeze-client/breeze.debug.js");
require("../node_modules/breeze-client");
// etc...
Only thing I can think of now is that there is an issue with the module that's causing a problem with browserify.
Does anyone know of a change that can be made to the module to get this to work or is there some setting in browserify that I need to use?
Complete error message when trying to run browserify directly on the breeze module:
C:\...>browserify "node_modules/breeze-client" -o "scripts/dist/breeze.js"
Error: Cannot find module 'breeze' from 'C:\...\node_modules\breeze-client'
at C:\...\node_modules\browserify\node_modules\resolve\lib\async.js:46:17
at process (C:\...\node_modules\browserify\node_modules\resolve\lib\async.js:173:43)
at ondir (C:\...\node_modules\browserify\node_modules\resolve\lib\async.js:188:17)
at load (C:\...\node_modules\browserify\node_modules\resolve\lib\async.js:69:43)
at onex (C:\...\node_modules\browserify\node_modules\resolve\lib\async.js:92:31)
at C:\...\node_modules\browserify\node_modules\resolve\lib\async.js:22:47
at FSReqWrap.oncomplete (fs.js:95:15)
need to make sure all references to require("breeze") were updated to require("breeze-client") inside the breeze.debug.js file as well as any adapters you might include from the build/adapters directory.
There is a pull-request in to fix this so hopefully it won't be a problem in future versions.

error when loading aurelia-validation plugin

I am trying to setup aurelia-validation plugin in my project. I am using VS2015.
I have installed aurelia-validation plugin using jspm install aurelia-validation command.
Config.js file has been updated "aurelia-validation": "github:aurelia/validation#0.2.7"
and in jspm_packages/github I see validation#0.2.7 folder.
I have added a plugin in my main.js file.
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.developmentLogging()
.plugin('aurelia-validation');
aurelia.start().then(a => a.setRoot());
}
and have changed my aurelia-app to aurelia-app="main"
When I start the app I get the following error in Firefox console:
Unhandled promise rejection TypeError: aurelia.globalizeResources is not a function
Stack trace:
configure#http://localhost:15724/jspm_packages/github/aurelia/validation#0.2.7/index.js:28:5
loadPlugin/<#http://localhost:15724/jspm_packages/github/aurelia/framework#0.15.0/aurelia-framework.js:34:32
run#http://localhost:15724/jspm_packages/npm/core-js#0.9.18/modules/es6.promise.js:91:43
notify/<#http://localhost:15724/jspm_packages/npm/core-js#0.9.18/modules/es6.promise.js:105:11
module.exports#http://localhost:15724/jspm_packages/npm/core-js#0.9.18/modules/$.invoke.js:6:25
#http://localhost:15724/jspm_packages/npm/core-js#0.9.18/modules/$.task.js:40:9
run#http://localhost:15724/jspm_packages/npm/core-js#0.9.18/modules/$.task.js:27:7
listner#http://localhost:15724/jspm_packages/npm/core-js#0.9.18/modules/$.task.js:31:5
I have tried clearing jspm cache with jspm cc command but that didn't help. All my packages are up to date.
What am I missing?
Thank you.
There was a breaking change in Aurelia 0.15.0:
In the commit fix(all): create a property framework configuration object
the globalizeResources method was renamed to globalResources
Since then (2015.08.13) the aurelia-validation plugin hasn't been updated.
You get the error because the aurelia-validation only supports aurelia 0.14.1 or older. So you have to downgrade your aurelia version to work with the validation plugin until it is not updated.
The accepted answer is correct. A quick fix (to avoid downgrading aurelia) would be to manually edit this line:
https://github.com/aurelia/validation/blob/master/dist/system/index.js#L10
in your jspm_packages\github\aurelia\validation... folder
Also change any aurelia.withSingleton calls to aurelia.container.registerSingleton

Categories

Resources