aboutsummaryrefslogtreecommitdiffstats
path: root/src/directives.js
AgeCommit message (Collapse)Author
2011-11-21fix(scope): $watch (and angular.equals) should support NaN valuesCodier
- since NaN !== NaN in javascript digest can get into an infinite loop when model value is set to NaN - angular.equals(NaN, NaN) should return true since that's what we expect when comparing primitives or objects containing NaN values Previously NaN because of its special === properties was used as the initial value for watches, but that results in issues when NaN is used as model value. In order to allow for model to be anything incuding undefined and NaN we need to mark the initial value differently in a way that would avoid these issues, allow us to run digest without major perf penalties and allow for clients to determine if the listener is being called because the watcher is being initialized or because the model changed. This implementation covers all of these scenarios. BREAKING CHANGE: previously to detect if the listener was called because the watcher was being initialized, it was suggested that clients check if old value is NaN. With this change, the check should be if the newVal equals the oldVal. Closes #657
2011-11-14refactor(injector): removed loadModule/ng:moduleMisko Hevery
- added module property to doc:example
2011-11-14style(docs): make jslint happy - fix some warningsVojta Jina
2011-11-14fix(doc) cleanup all api doc link warningsMisko Hevery
2011-11-14new(directive): added ng:module directive for loading modulesMisko Hevery
2011-11-14refactor(filter): filters are now injectable and servicesMisko Hevery
BREAK: - removed CSS support from filters
2011-11-14refactor(parser): turn parser into a service (keep compatibility hack)Misko Hevery
2011-11-14refactor($service): removed almost all references to scope.$serviceMisko Hevery
- still need to remove from factory
2011-11-08fix(directives): make directive names case-insensitiveIgor Minar
+ tests + added docs for angular.directive
2011-11-08feat(ng:style): compatibility + perf improvementsDhruv Manek
- better compatibility with 3rd party code - we clober 3rd party style only if it direcrtly collides with 3rd party styles - better perf since it doesn't execute stuff on every digest - lots of tests
2011-11-08docs(ng:bind-attr): improve examplesIgor Minar
2011-10-12docs(*): remove @workInProgress from everywhereIgor Minar
it's not useful any more and it only makes the docs look ugly
2011-10-12refactor(ng:bind-attr): simplify impl by leveraging jqueryIgor Minar
2011-10-12fix(ng:class): ignore undefined or NaN classnamesIgor Minar
2011-10-11chore(formating): clean code to be function() {Misko Hevery
2011-10-11feat(forms): new and improved formsMisko Hevery
2011-10-11refactor(bindings): remove the decoration of the DOM with errors.Misko Hevery
Only $exceptionHandler gets notified now.
2011-10-11refactor(injection) infer injection args in ng:controller onlyMisko Hevery
Because only controllers don't have currying, we can infer its arguments, all other APIs needing currying, automatic inference complicates the matters unecessary.
2011-09-28chore(directives): add a todo for ng:styleIgor Minar
2011-09-16fix(e2e tests): use prop() instead of attr() and quote attributesIgor Minar
Because of changes in jQuery, we need to use element().prop() instead of element().attr() to retrieve className and other element properties. Additionally all attribute selectors (e.g. input[name=value]) must have value quoted if it contains dots (".").
2011-09-01docs(ng:bind): fix example codeIgor Minar
2011-09-01fix(ng:class): make ng:class friendly towards other code adding/removing classesIgor Minar
ng:class as well as ng:class-odd and ng:class-even always reset the class list to whatever it was before compilation, this makes it impossible to create another directive which adds its own classes on the element on which ng:class was applied. the fix simply removes all classes that were added previously by ng:class and add classes that the ng:class expression evaluates to. we can now guarantee that we won't clobber stuff added before or after compilation as long as all class names are unique. in order to implement this I had to beef up jqLite#addClass and jqLite#removeClass to be able to add/remove multiple classes without creating duplicates.
2011-09-01docs(API): various api doc fixes from ToniIgor Minar
2011-08-24feat(ng:cloak): add ng:cloak directiveIgor Minar
2011-08-24doc(API): various API documentation improvementsToni Thompson
2011-08-15refactor(jqLite): remove jqLite show/hide supportIgor Minar
it turns out that even with our tricks, jqLite#show is not usable in practice and definitely not on par with jQuery. so rather than introducing half-baked apis which introduce issues, I'm removing them. I also removed show/hide uses from docs, since they are not needed. Breaks jqLite.hide/jqLite.show which are no longer available.
2011-08-15style(*): wrap all assignments in if statementsIgor Minar
we commonly assign stuff in if statments like this: if (variable = someFn()) { //do something with variable } This results in lint and IDE warnings (did you mean ==?). It is better to be explicit about our intention and wrap the assignement into parens: if ((variable = someFn())) { //do something with variable } Doing so suppresses warnings + is easier to understand the intention. I verified that the closure compiler strips the extra parens, so there is no byte overhead for this safety practice. We should use this style going forward...
2011-08-14fix(directives): make ng:class-even/odd work with ng:classDi Peng
Closes #508
2011-08-12perf(scope): re-enable statement cacheingMisko Hevery
2011-08-12refactor(scope): remove $flush/$observe ng:eval/ng:eval-orderMisko Hevery
2011-08-02feat(scope): new and improved scope implementationMisko Hevery
- Speed improvements (about 4x on flush phase) - Memory improvements (uses no function closures) - Break $eval into $apply, $dispatch, $flush - Introduced $watch and $observe Breaks angular.equals() use === instead of == Breaks angular.scope() does not take parent as first argument Breaks scope.$watch() takes scope as first argument Breaks scope.$set(), scope.$get are removed Breaks scope.$config is removed Breaks $route.onChange callback has not "this" bounded
2011-07-30doc(typos): fix couple of typos in the docsdandoyon
Minor documentation fixes. Should not be any code changes. One test changed due to dependency on text in documentation.
2011-07-26fix(ng:show/ng:hide): use jqLite.show/jqLite.hideDi Peng
The previous implementation didn't handle situation when in css something was hidden with a cascaded display:none rule and then we wanted to show it. Unfortunatelly our test doesn't test this scenario because it's too complicated. :-/
2011-07-19Revert "fix(ng:class): preserve classes added post compilation"Igor Minar
This reverts commit 2428907259fa80ec3b1b4bfd85ea20028a9f4fa5. We decided to revert this because it is not bullet proof. The issue is that we can't reliably have both angular and non-angular code in charge of the DOM. We could work around some issues here and there, but we can't do it reliably, so it's better not to support DOM manipulation that happens outside of angular. There is a good chance that once we integrate with MDVs our possition will change, but until then our position is that only angular or angular widgets/directives can change change DOM that was compiled.
2011-07-18feat(strict mode): adding strict mode flag to all js filesIgor Minar
the flag must be in all src and test files so that we get the benefit of running in the strict mode even in jstd the following script was used to modify all files: for file in `find src test -name "*.js"`; do echo -e "'use strict';\n" > temp.txt cat $file >> temp.txt mv temp.txt $file done
2011-07-18doc(misc): fixing typos in docsIgor Minar
2011-07-17refactor(docs): run e2e tests with and without jqueryDi Peng
- e2e tests will run index.html (without jquery) and with index-jq.html(with jquery). - many small changes to make e2e tests work withough JQuery as we discover problems that were previously hidden by using real JQuery.
2011-07-13fix(ng:class): preserve classes added post compilationDi Peng
- make sure ng:class preserve classes added after compilation Closes #355
2011-06-16Added ng:disabled, ng:checked, ng:multiple, ng:readonly, ng:selected to ↵Di Peng
markup.js. Also added coresponding descriptions live examples and tests for each directive to be displayed on the website. Closes #351
2011-06-08Added ng:options directiveMisko Hevery
Closes #301
2011-06-08Refactor injector to have invoke method for speed reasonsMisko Hevery
2011-06-06yet another docs batchIgor Minar
2011-06-06api doc fixes from kenIgor Minar
2011-06-06Fix wrong links in source codeVojta Jina
2011-06-06fixing broken linksIgor Minar
2011-04-11doc fix - ng:autobind, ng:controller and moreKenneth R. Culp
2011-03-26remove _null and _undefinedIgor Minar
they have no significant effect on minified and gziped size. in fact they make things worse. file | before | after removal ---------------------------------------- concat | 325415 | 325297 min | 62070 | 62161 min + gzip | 25187 | 25176 The bottom line is that we are getting 0.05% decrease in size after gzip without all of the hassle of using underscores everywhere.
2011-02-18Remove ng:watchMisko Hevery
Closes#143
2011-02-16reformated multiline trinary expressions to have a leading ?/:.Misko Hevery
2011-02-16Small spelling and grammar fixes in documentation.Anthony Lieuallen