-
Notifications
You must be signed in to change notification settings - Fork 81
Conversation
Awesome! Just a few changes that I'll note when I get to a computer. Thanks! |
Glad I could help, I feel so useful now :D |
@@ -0,0 +1,5 @@ | |||
## 2015-02-19 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding a Changelog. Good to have. Could you change this line to:
# 3.0.2
You know what. I think I would prefer to make this a template manipulator rather than a wrapper. So you'd do something like this: Place the file in a new directory called angular.module('formlyBootstrap').run(function(formlyConfig, $http, $templateCache) {
formlyConfig.templateManipulators.postWrapper.push(function(template, options) {
if (!options.templateOptions.addonLeft && !options.templateOptions.addonRight) {
return template;
}
return $http.get('other/formly-templates-bootstrap-addons.html', {
cache: $templateCache
}).then(function(response) {
return response.data.replace('<formly-transclude></formly-transclude>', template);
});
});
}); Does that make sense? |
The reason I would do this is that way this only applies to fields that have an |
I'm adding this example to the formly website. Hopefully it's helpful :-) |
I will try to grasp it in the upcoming days and understand better what the difference between the two approaches are. In all honesty, I am not a great fan of the way I manage all thos ng-if that make the code quite hard to read. The approach you suggest would make the html easier to read, and simplify things, so that seem good to me. |
Ah, understood. I usually use |
I could change it to an |
How can I restrict the template replacement to input only? Following your suggestion, I think it makes more sense to allow add-ons for input only, and maybe extend it for other controls at a later stage. |
span replaced by i for icon use of template replacer
At the top of your function, check that |
I made the updates according to the discussion: replaced span by i and use of templateManipulator. |
Yes, you'll need to update the grunt build to look for files from the |
Oops, my bad for the formatting, I did an auto reformat by reflex, and did not check the configuration. |
No worries 👍 thanks for the help! |
Indentation of 2 spaces isntead of 4
Hi again, |
return template; | ||
} | ||
var tmpl = $templateCache.get('other/formly-other-bootstrap-addons.html'); | ||
return tmpl.replace('<formly-transclude></formly-transclude>', template); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment has been moved.
I don't think that I do get notified when you commit changes. |
} | ||
]); | ||
} | ||
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to be so nit-picky, but the whitespace around here is all messed up. Please make sure that you're indenting with 2 spaces. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ew you are totally right, thatt's ugly ::shame::
Wil fix this tomorrow
I think it's looking good. I'll take a little time later to pull it down, test it out, run the build, increment the version, and publish the new version. Thanks! |
Thanks to you for your help and advice, let me know how it goes. I created an example to test it, I can push it to my git if that is of interest, or create a jsbin if formly is available through cdn? |
Would totally love a test. Feel free to make it part of this PR. And for the jsbin example, that would be awesome as well. Please go to the website and click on "Suggest an example" |
I corrected the indentation. |
Thanks. For the example, please go to the website and click on "Suggest an example" |
Great, I'm on it! |
@Ledragon, I'm working on this now. I have a few other things I want to do for the next release. Don't worry, your work wont go to waste :-) |
Thanks for the feedback! |
I'm not sure why this didn't show it as merged, but I've merged your PR and added a bunch of stuff in 4.0.0 :-D Thanks for your contribution! |
http://www.quickmeme.com/meme/3uwe8u |
I'm not familiar with feedback icons, but it definitely belongs in another issue. |
I will do that later then, together with an example so that you can see what I mean and decide whether it's interesting for this repo or not! |
New wrapper for input add-ons on left and right of fields, through text or css class