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

How to instantiate a dynamic area of arrays with a speicific height and width #10

Open
vandanachadha opened this issue Jan 11, 2018 · 2 comments
Labels

Comments

@vandanachadha
Copy link

The array of aras is dynamic, and on click, the area which gets created needs to be a specific width and height.
I have tried with following:
First try:
$scope.onAddArea = function (ev, box, areas, area) {
box.height = 50;
box.width = 50;

Second Try with ng-areas-extend-data:
<img alt="signature" ng-areas="Signatures" ng-areas-width="800"
ng-areas-on-add="onAddArea"
ng-areas-extend-data="{height:50,width:300}"

None of these open up the area with the specific size. Could you please help?

@delkant
Copy link
Owner

delkant commented Jan 11, 2018

If you look at the documentation the onAddArea handler takes and id as the second paramenter:

ng-areas-on-add (null): fired when a selection is released. arguments : (event, id, areas, area)

Can you try:

$scope.onAddArea = function(ev, boxId, areas, area) {
area.height=50;
area.width=50;
}

you might need to use $scope.$apply();

It have been a while since the last time I worked with this library, so please let me know if this helps or not.

@vandanachadha
Copy link
Author

vandanachadha commented Jan 12, 2018 via email

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