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

Event to Change areas dynamically #5

Closed
ghachemsaif opened this issue Jun 29, 2017 · 6 comments
Closed

Event to Change areas dynamically #5

ghachemsaif opened this issue Jun 29, 2017 · 6 comments
Labels

Comments

@ghachemsaif
Copy link

ghachemsaif commented Jun 29, 2017

Hello,
Thanks for this awesome plugin,
But i have a litle problem :

How i can make an event to change the point instantly.
For the moment i have tried this in my controller :

$scope.ChangeAreas = function () {
            var NewtestData = [{
                "x": 557,
                "y": 135,
                "z": 500,
                "height": 75,
                "width": 75,
                "name": '',
                "cssClass": "marker_add mrk1",
                "id": 37,
                "description": "Menu"
            }];
            $scope.fields900 = NewtestData.slice(0);
            $scope.$apply();
            console.log('change')
        }
@delkant
Copy link
Owner

delkant commented Jun 30, 2017

Hi Thanks,
What do you mean by changing the points? you want to be able to move a box area passing by the coordinates? or you want to detect an event when a box area is changing?

@ghachemsaif
Copy link
Author

actually i want to make a button to change the areas object, and add another areas

@ghachemsaif ghachemsaif changed the title Event to Change points dynamically Event to Change areas dynamically Jun 30, 2017
@delkant
Copy link
Owner

delkant commented Jun 30, 2017

There is a important field miss in the documentation 'areaid' you can assign a unique areaid to every area box you are creating and then iterate through the areas to find out if that is the area you want to change, modify that area, and then $scope.$apply()

@ghachemsaif
Copy link
Author

ghachemsaif commented Jun 30, 2017

I get an error :
Error: [$rootScope:inprog] $digest already in progress

help please !
https://jsfiddle.net/95joj0cL/2/

@delkant
Copy link
Owner

delkant commented Jul 1, 2017

@delkant delkant closed this as completed Jul 1, 2017
@ghachemsaif
Copy link
Author

Delkant,
Thanks But the areas will duplicated after the change event
Look at this please : http://jsfiddle.net/a21xt52h/7/

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

No branches or pull requests

2 participants