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

Change button don't update new image preview #325

Open
francisrod01 opened this issue Apr 19, 2017 · 0 comments
Open

Change button don't update new image preview #325

francisrod01 opened this issue Apr 19, 2017 · 0 comments

Comments

@francisrod01
Copy link

Hi, I have a problem with change event to new image in form.

I try reproduct a single form upload as code example.but I did not have success.

Note: controller.dropEnabled is a parameter in controller initialize with true.

<div class="form-group" 
	flow-init
	flow-file-added="controller.addedFile($event, $file, $flow)"
    flow-drag-enter="style={border: '5px solid green'}"
    flow-drag-leave="style={}"
    ng-style="controller.dropEnabled && style">

	<div class="thumbnail" ng-hide="$flow.files.length">
		<img ng-src="images/no-image_200x150.png" alt="No image"/>
	</div>

	<div class="thumbnail" ng-show="$flow.files.length">
		<img flow-img="$flow.files[0]" />

		<!-- or this image implementation below... -->
		<img app-flow-img="$flow.files[0]" app-flow-img-change="src=$src" ng-src="<% src %>"/>
	</div>


	<div class="form-group">
		<div class="form-group" ng-hide="$flow.files.length">
			<button type="button" class="btn btn-success"
			flow-btn>
			Select image
		</button>

		<p class="form-group" style="margin-top:5%;">OR</p>
	</div>

	<button type="button" class="btn btn-primary" ng-show="$flow.files.length" flow-btn>
		Change
	</button>

	<div class="form-group alert" flow-drop flow-drag-enter="class='alert-success'"
		flow-drag-leave="class=''" ng-style="controller.dropEnabled && class && !!$flow.files.length"
		style="text-align: center; padding: 100px 0;">
		Drag And Drop your file here
	</div>

</div>

References

http://flowjs.github.io/ng-flow/
Issue #37 - Binding to existing image

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

1 participant