Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error 'call back is not a function' when running with angular 1.5.8 #51

Open
kslo88 opened this issue Aug 2, 2016 · 14 comments
Open

Error 'call back is not a function' when running with angular 1.5.8 #51

kslo88 opened this issue Aug 2, 2016 · 14 comments

Comments

@kslo88
Copy link

kslo88 commented Aug 2, 2016

Hi,

Getting below error when running with angular 1.5.8.

Error: scope.callback is not a function
.link/</reader.onload/</<@http://192.168.56.101:9000/bower_components/angular-csv-import/dist/angular-csv-import.js:68:8
$RootScopeProvider/this.$get</Scope.prototype.$digest@http://192.168.56.101:9000/bower_components/angular/angular.js:16789:13
$RootScopeProvider/this.$get</Scope.prototype.$apply@http://192.168.56.101:9000/bower_components/angular/angular.js:17003:13
.link/</reader.onload@http://192.168.56.101:9000/bower_components/angular-csv-import/dist/angular-csv-import.js:58:6

http://192.168.56.101:9000/bower_components/angular/angular.js
Line 13294

@JohnTheBeloved
Copy link

The value has to be a variable and not just a value like so callback="callbackvariable" and not callback="callbackfunction()"

The callback would be a variable in the scope assigned to a function

function callback function(){
   //do stuff here
}

$scope.callbackvariable = callbackfuntion;

@JohnTheBeloved
Copy link

Apologies, this doesn't work, it doesn't resolve scope changes

@osalama7
Copy link

osalama7 commented Aug 9, 2016

Hello, I'm facing the same issue with integration of this component , I'm running the code from the example in main.js file in this repo.
The error occurs when I import a file within my node app code, the scope is loaded with results correctly, but the console logs the TypeError: scope.callback is not a function at angular-csv-import: 68
I'm wondering whats wrong with my integration, because I can't fix the entire code of the module.

@roberttolton
Copy link

+1
Running angular.js 1.5.8 and getting TypeError: scope.callback is not a function

@SarasArya
Copy link

+1 Running angular.js 1.5.8 and getting TypeError : scope.callback is not a function

@nainyshah
Copy link

can anybody resolve this error

@csacanam
Copy link

Same error here with Angular 1.4.0

@nainyshah
Copy link

To Fix, this issue finds the instructions below.

in your HTML

In Controller

$scope.csvCallback = function (result) {
// alert("define anything")
}

@guptaaman2011
Copy link

not working

@lbicknese
Copy link

In the definition of the directive the callback attribute is using = for bidirectional binding; It should probably use & to bind to an expression. This would allow the use of the callback similar to ngChange or ngClick.

@nainyshah
Copy link

nainyshah commented Sep 17, 2016

add this into ur controller.

$scope.csv = {
content: null,
header: true,
headerVisible: true,
separator: ',',
separatorVisible: true,
result: null,
encoding: 'ISO-8859-1',
encodingVisible: true,
accept: true,
callback: 'csvCallback'
};

$scope.csvCallback = function (result) {
   // alert($scope.res)
}

In ur html it should be like this

@srokatonie
Copy link

srokatonie commented Nov 1, 2016

Calback is simply not doing anything...
@nainyshah Do you have working example?

@nainyshah
Copy link

@srokatonie This code is copied from the project I am working on .......and it works perfectly.

@srokatonie
Copy link

@nainyshah turned out I am using outdated (2015) package that was available on npmjs... I build npm package with the most recent version of this repo if anyone needs it:
https://www.npmjs.com/package/angular-csv-import-recent

However I noticed when debugging that callback is called many more times, not only when it finishes processing or setting is changed...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants