Git Product home page Git Product logo

Comments (3)

koorgoo avatar koorgoo commented on July 17, 2024

A good practice is to $emit events on $rootScope. There is no $emitting in ngCropper yet.
The scenario to think about is when there are several croppers on the page. Need to know how to identify which cropper instance triggered the event.

from ngcropper.

nachoargentina avatar nachoargentina commented on July 17, 2024

Hi stianjensen!
One thing that I did to be able to run things after the "built.cropper" event is emited, is defining a 'built' function inside the options object.
For example:

$scope.options = {
                maximize: true,
                aspectRatio: 1/1,             
                built: function() {                 
                    $scope.determineAspectRatio(vm.fileTypeTitle);
            };
}

This way you can define whatever function you want to run for each specific instance of a cropper.
Hope that helps you in any way!

from ngcropper.

stianjensen avatar stianjensen commented on July 17, 2024

Thanks, @nachoargentina

I see that the cropper plugin has made some changes in v11.0 related to events:

Convert "crop" option to "crop" event

So to support the next version of cropper, some way of listening to events would be required.

(https://github.com/fengyuanchen/cropper/blob/master/CHANGELOG.md#0110-aug-10-2015)

from ngcropper.

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.