Comparing changes
Open a pull request
- 4 commits
- 4 files changed
- 6 commit comments
- 3 contributors
…ation Change a sentence which describes how currencyConverter service is instantiated
This now uses the same technique as ngRepeat.
- +2 −2 docs/content/guide/concepts.ngdoc
- +5 −5 src/ng/directive/input.js
- +3 −1 src/ng/directive/ngClass.js
- +1 −1 src/ng/sniffer.js
| @@ -277,8 +277,8 @@ Now that Angular knows of all the parts of the application, it needs to create t | ||
| In the previous section we saw that controllers are created using a factory function. | ||
| For services there are multiple ways to define their factory | ||
| (see the {@link services service guide}). | ||
| In the example above, we are using a function that returns the `currencyConverter` function as the factory | ||
| for the service. | ||
| In the example above, we are using an anonymous function as the factory function for `currencyConverter` service. | ||
| This function should return the `currencyConverter` service instance. | ||
|
|
||
| Back to the initial question: How does the `InvoiceController` get a reference to the `currencyConverter` function? | ||
| In Angular, this is done by simply defining arguments on the constructor function. With this, the injector | ||
| @@ -100,11 +100,11 @@ var inputType = { | ||
| <span class="error" ng-show="myForm.input.$error.pattern"> | ||
| Single word only!</span> | ||
| </div> | ||
| <tt>text = {{example.text}}</tt><br/> | ||
| <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/> | ||
| <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/> | ||
| <tt>myForm.$valid = {{myForm.$valid}}</tt><br/> | ||
| <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/> | ||
| <code>text = {{example.text}}</code><br/> | ||
| <code>myForm.input.$valid = {{myForm.input.$valid}}</code><br/> | ||
| <code>myForm.input.$error = {{myForm.input.$error}}</code><br/> | ||
| <code>myForm.$valid = {{myForm.$valid}}</code><br/> | ||
| <code>myForm.$error.required = {{!!myForm.$error.required}}</code><br/> | ||
| </form> | ||
| </file> | ||
| <file name="protractor.js" type="protractor"> | ||
| @@ -69,7 +69,9 @@ function classDirective(name, selector) { | ||
| } | ||
|
|
||
| function ngClassWatchAction(newVal) { | ||
| if (selector === true || scope.$index % 2 === selector) { | ||
| // jshint bitwise: false | ||
| if (selector === true || (scope.$index & 1) === selector) { | ||
| // jshint bitwise: true | ||
| var newClasses = arrayClasses(newVal || []); | ||
| if (!oldVal) { | ||
| addClasses(newClasses); | ||
| @@ -36,7 +36,7 @@ function $SnifferProvider() { | ||
| for (var prop in bodyStyle) { | ||
| if (match = vendorRegex.exec(prop)) { | ||
| vendorPrefix = match[0]; | ||
| vendorPrefix = vendorPrefix.substr(0, 1).toUpperCase() + vendorPrefix.substr(1); | ||
| vendorPrefix = vendorPrefix[0].toUpperCase() + vendorPrefix.substr(1); | ||
| break; | ||
| } | ||
| } | ||
Showing you all comments on commits in this comparison.
This comment has been minimized.
This comment has been minimized.
|
Are there any decent performance-tests to check if this helps? http://jsbin.com/manufayizo/edit?html,js,output EDIT: I see there's a perfTest in #4359, but it's unavailable. |
This comment has been minimized.
This comment has been minimized.
|
Micro benchmarks are probably not indicative of real performance |
This comment has been minimized.
This comment has been minimized.
|
I agree. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Indeed. But the test is not available anymore, and it has the extreme claims of being 99% faster, which my test does not show at all. |
This comment has been minimized.
This comment has been minimized.
Do you suggest we replicate all POC jsperf tests which are mentioned in every commit ever merged into master?
99% faster isn't as extreme; it's twice as fast. This result doesn't indeed seem to still be true for today's browsers, but this was almost 3 years ago - browsers and especially JS engines have seem major improvements, so situations like these are expected. |