Coder Social home page Coder Social logo

Comments (14)

nainyshah avatar nainyshah commented on July 18, 2024 4

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

from angular-csv-import.

JohnTheBeloved avatar JohnTheBeloved commented on July 18, 2024

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;

from angular-csv-import.

JohnTheBeloved avatar JohnTheBeloved commented on July 18, 2024

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

from angular-csv-import.

osalama7 avatar osalama7 commented on July 18, 2024

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.

from angular-csv-import.

roberttolton avatar roberttolton commented on July 18, 2024

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

from angular-csv-import.

SarasArya avatar SarasArya commented on July 18, 2024

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

from angular-csv-import.

nainyshah avatar nainyshah commented on July 18, 2024

can anybody resolve this error

from angular-csv-import.

csacanam avatar csacanam commented on July 18, 2024

Same error here with Angular 1.4.0

from angular-csv-import.

nainyshah avatar nainyshah commented on July 18, 2024

To Fix, this issue finds the instructions below.

in your HTML

In Controller

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

from angular-csv-import.

guptaaman2011 avatar guptaaman2011 commented on July 18, 2024

not working

from angular-csv-import.

lbicknese avatar lbicknese commented on July 18, 2024

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.

from angular-csv-import.

srokatonie avatar srokatonie commented on July 18, 2024

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

from angular-csv-import.

nainyshah avatar nainyshah commented on July 18, 2024

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

from angular-csv-import.

srokatonie avatar srokatonie commented on July 18, 2024

@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...

from angular-csv-import.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.