aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/directive/select.js
AgeCommit message (Collapse)Author
2014-03-18fix(select): avoid checking option element selected properties in renderJeff Balboni
In Firefox, hovering over an option in an open select menu updates the selected property of option elements. This means that when a render is triggered by the digest cycle, and the list of options is being rendered, the selected properties are reset to the values from the model and the option hovered over changes. This fix changes the code to only use DOM elements' selected properties in a comparison when a change event has been fired. Otherwise, the internal new and existing option arrays are used. Closes #2448 Closes #5994
2014-02-28style: enable jscs requireRightStickedOperators ruleIgor Minar
2014-02-16docs(bike-shed-migration): fix invalid </file name=""> HTML in examplesPeter Bacon Darwin
2014-02-16docs(bike-shed-migration): let markdown deal with extenal linksPeter Bacon Darwin
It is problematic to use {@link} tags with external links because the markdown parser converts them to links for us before we parse the @links. This means that the following tag: ``` {@link http://www.google.com Google} ``` get converted to: ``` {@link <a href="http://www.google.com/"></a> Google} ``` Our {@link} parser then converts this to: ``` <a href="<a">&lt;</a>href="http://www.google.com/"></a> Google} ``` which is clearly a mess. The best solution is not to use {@link} tags for external links and just use the standard markdown syntax: ``` [Google](http://www.google.com) ``` In the long run, we could look into configuring or modifying `marked` not to convert these external links or we could provide a "pre-parser" processor that dealt with such links before `marked` gets its hands on it.
2014-02-16docs(bike-shed-migration): convert <doc:...> examples to <example>...Peter Bacon Darwin
2014-02-16docs(bike-shed-migration): convert doctype and namesPeter Bacon Darwin
2014-01-28test(docs): convert example end to end doc tests from scenario runner to ↵Julie
protractor Thanks to jeffbcross, petebacondarwin, btford, jdeboer, tbosch for contributions! Closes #6023
2014-01-26docs(select): rephase note on ngOptionsDavid Nelson
added 'an' and 'the' to ngOptions sentence Closes #5993
2014-01-21docs(select): add callout style for a noteBrian Ford
2014-01-21docs(select): add object comparison warningDan Matthews
2014-01-10docs(select): update regexp grouping cheat-sheatAjay Roopakalu
Update the regexp grouping comment to reflect the changes needed for multiline expressions in ng-options for <select>. Closes #5602
2014-01-10feat(select): allow multiline ng-optionsAjay Roopakalu
This patch allows the ng-options value of a <select> element to span multiple lines, which would previously throw an error when used with filters. Closes #5602
2013-12-17fix(select): invalidate when 'multiple`, `required` and model is `[]`Caitlin Potter
When `multiple` attribute is set on a `<select>` control and the model value is an empty array, we should invalidate the control. Previously, this directive was using incorrect logic for determining if the model was empty. Closes #5337
2013-12-13perf(jqLite): implement and use the `empty` method in place of `html(‘’)`Michał Gołębiowski
jQuery's elem.html('') is way slower than elem.empty(). As clearing element contents happens quite often in certain scenarios, switching to using .empty() provides a significant performance boost when using Angular with jQuery. Closes #4457
2013-10-24docs(select): fix typowiebl
Closes #4433
2013-10-22style: make jshint happyVojta Jina
2013-10-07fix(*): protect calls to hasOwnProperty in public APIPeter Bacon Darwin
Objects received from outside AngularJS may have had their `hasOwnProperty` method overridden with something else. In cases where we can do this without incurring a performance penalty we call directly on Object.prototype.hasOwnProperty to ensure that we use the correct method. Also, we have some internal hash objects, where the keys for the map are provided from outside AngularJS. In such cases we either prevent `hasOwnProperty` from being used as a key or provide some other way of preventing our objects from having their `hasOwnProperty` overridden. BREAKING CHANGE: Inputs with name equal to "hasOwnProperty" are not allowed inside form or ngForm directives. Before, inputs whose name was "hasOwnProperty" were quietly ignored and not added to the scope. Now a badname exception is thrown. Using "hasOwnProperty" for an input name would be very unusual and bad practice. Either do not include such an input in a `form` or `ngForm` directive or change the name of the input. Closes #3331
2013-10-07style(select): fix semicolons and varsPeter Bacon Darwin
2013-10-03docs(select): clarify usagegdennie
The wording seemed confusing and these adjustments seem to capture the intent with less turbulence. Closes #4257
2013-10-01refactor(select): simplify the ngOptions regular expressionStefan hr Berder
\w matches [a-zA-Z0-9_] and \d matches [0-9], using both in a character set is simply redundant. Closes #3903
2013-09-13fix(ngOptions): ignore object properties which start with $Gowtam Lal
2013-06-19feat(jqLite): switch bind/unbind to more recent jQuery on/offMichał Gołębiowski
jQuery switched to a completely new event binding implementation as of 1.7.0, centering around on/off methods instead of previous bind/unbind. This patch makes jqLite match this implementation while still supporting previous bind/unbind methods.
2013-06-17chore(minErr): replace ngError with minErrKen Sheedlo
2013-06-13docs(select): fix typos in ngOptionsMisha Moroshko
2013-05-24feat(ngError): add error message compression and better error messagesIgor Minar
- add toThrowNg matcher
2013-05-14feat(select): match options by expression other than object identityquazzie
Extend ng-options with a new clause, "track by [trackByExpression]", which can be used when working with objects. The `trackByExpression` should uniquely identify select options objects. This solves the problem of previously having to match ng-options objects by identity. You can now write: `ng-options="obj as obj.name for obj in objects track by obj.id"` The "track by" expression will be used when checking for equality of objects. Examples: <select ng-model="user.favMovieStub" ng-options="movie as movie.name for movie in movies track by movie.id"> </select> scope: { user: { name: 'Test user', favMovieStub: { id: 1, name: 'Starwars' } } movies: [{ id: 1, name: 'Starwars', rating: 5, ... }, { id: 13, ... }] } The select input will match user favMovieStub to the first movie in the movies array, and show "Star Wars" as the selected item.
2013-05-07fix(select): ensure empty option is not lost in IE9Chad Smith
Fix a check inside render for select elements with ngOptions, which compares the selected property of an element with it's desired state. Ensure the placeholder, if available, is explicitly selected if the model value can not be found in the option list. Without these fixes it's up to the browser implementation to decide which option to choose. In most browsers, this has the effect of displaying the first item in the list. In IE9 however, this causes the select to display nothing. Closes #2150, #1826
2013-04-19docs(select): fix attribute documentationShyam Seshadri
Select documentation was still referring to binding to name, when it should be ng-model instead. Fixed it.
2013-03-20chore(select): Fix ngOptions regexp capture comment.Arlen Christian Mart Cuss
Off-by-one error.
2012-12-05fix(select): support optgroup + select[multiple] combo_pants
Closes #1553
2012-11-25docs(api): add ngRequired to input/select/textarea directivesDean Sofer
Closes #1202
2012-10-31fix(select): select option with a label of 0 is not shownSudhir Jonathan
Bug caused by the use of the `||` operator to replace all non-truthy values with an empty string. Changed to replace only `undefined` values. Closes #1401
2012-09-06fix(*): name all anonymous watch functions in AngularShyam Seshadri
This will allow us to see function names in Batarang and debugger. Closes #1119
2012-08-10fix(option): support option elements in datalistIgor Minar
previously we expected to find option elements only within select element and if that was not the case we throw an error. This made it impossible to include datalist element with nested option elements in the template. Closes #1165
2012-06-12docs(*): simplify doc urlsIgor Minar
we now have two types of namespaces: - true namespace: angular.* - used for all global apis - virtual namespace: ng.*, ngMock.*, ... - used for all DI modules the virual namespaces have services under the second namespace level (e.g. ng.) and filters and directives prefixed with filter: and directive: respectively (e.g. ng.filter:orderBy, ng.directive:ngRepeat) this simplifies urls and makes them a lot shorter while still avoiding name collisions
2012-05-04chore(docs): re-skin main documentationMisko Hevery
2012-05-02fix(select): don't interfere with selection if not databoundIgor Minar
Closes #926
2012-04-20fix(select): properly handle empty & unknown options without ngOptionsIgor Minar
Previously only when ngOptions was used, we correctly handled situations when model was set to an unknown value. With this change, we'll add/remove extra unknown option or reuse an existing empty option (option with value set to "") when model is undefined.
2012-04-10chore(*): remove dead code and fix code style issuesIgor Minar
2012-04-09fix(docs): change all directive references to use the normalized namesIgor Minar
2012-03-28chore(module): move files around in preparation for more modulesMisko Hevery