Comments (6)
Thanks, I'll look into this. In the meantime can you update your example to include commented code
- currently its just <a>
tag links that seem to be broken.
You can use the ``` tag as well to format blocks of code.
// this is a block
// of code
from angular-unsavedchanges.
Also you would never write <a><button></a>
as you have in your title, that just isn't proper html. Remember that buttons
need ng-click
while<a>
tags need href
Something like this,
<button ng-click="processFrom()">Process Form</button>
<a ng-href="/visit-url">Visit Url</a>
from angular-unsavedchanges.
Thanks for that, I have commented the links so you can see the code. The first version, which is a bit ugly now I come to think of it -I could use the button classes in the <a>
tag, used to work, but no longer does with the form using the directive. I changed it to the second version, which works fine.
I also had a problem with multiple forms on one page, but I decided that I didn't really need that and changed the code to be one form.
from angular-unsavedchanges.
A few things, first thanks for clarifying the example code with comments.
Next, there is a bug with the current directive and multiple forms. I've fixed this and will be updating the code soon. An easy fix in the meantime, like you did, is to just use a single form.
Lastly, the fact this directive effects the functionality of buttons and links within it is odd (as you noted the link works fine when the directive is removed.). This needs more investigation. However, you really should fix the syntax errors - its not proper to put a <button>
inside an <a>
tag - and this will lead to all types of problems and inconsistent behaviors. See http://stackoverflow.com/a/6393863 for details.
A few suggestions, I noticed you're using the bootstrap class btn
. If you are using a button solely style, remember you can add the btn
class to a link for the same effect.
<a href="/mylink" class="btn">This link will look like a bootstrap button<a>
In addition, you could apply the ng-show attr to the link itself, there's really no need to wrap it with a span
<a ng-hide="user.has_file" href="/mylink" class="btn">This link will look like a bootstrap button<a>
This would clean up your code a bit. Hope this helps!
from angular-unsavedchanges.
It does thanks, I'm more of a backend person.
from angular-unsavedchanges.
@derbexuk check out https://github.com/facultymatt/angular-unsavedChanges/tree/develop for updates that fix multiple form issues. Thanks!
from angular-unsavedchanges.
Related Issues (20)
- Do not set form to $pristine state while HTTP call is in progress.
- ngTable Coloumn Customization HOT 3
- unsaved-warning-clear doesn't work with other directives asking for new/isolated scope
- Confirm Box is Displaying [Object,Object] HOT 1
- Add support for working with angular-input-modified
- Add support for usage within Modal Dialogs
- Use onunload in IE 9 instead of onbeforeunload HOT 1
- Warning alert shows up twice HOT 6
- Looking to disable the directive based on condition
- Upload to NPM HOT 1
- Anyone using angular-gettext? HOT 3
- How can I use it for RequireJS
- Project status - abandoned? HOT 4
- This doesn't seem to be injecting properly with angular 1.5.x
- Ipad bug
- Exclude Warning Messages to Specific Routes (Server route)
- Not injecting properly for deploy
- Not working on refresh
- Not working with upload file
- Does it support the version 1 of ui-router?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-unsavedchanges.