When I upgrade the the ng-repeat takes extraordinarily long to load and tries to display MORE content boxes without the content that is being served by $resource.
I have narrowed the problem down to the update between 1.1.0 and 1.1.1. I looked through the changelog but nothing popped out at me to be the culprit, but it must be in there.
Changelog => https://github.com/angular/angular.js/blob/master/CHANGELOG.md#111-pathological-kerning-2012-11-26
The repository for this app => https://github.com/brianpetro/resume
Currently my angular looks like:
app = angular.module("Resume", ["ngResource"])
app.factory "Entry", ["$resource", ($resource) ->
$resource("/entries")
]
@EntryCtrl = ["$scope", "Entry", ($scope, Entry) ->
$scope.entries = Entry.query()
]
This happens on multiple views with using ng-repeat:
<html ng-app="Resume">
<div ng-controller="EntryCtrl">
<ul>
<li ng-repeat="entry in entries">
{{entry.title}}
</li>
</ul>
</div>
</html>
This is AngularJS version 1.1.0: This is AngularJS version 1.1.1:
It's not entirely true that you have to add .json - at least not from my experience when I have switched from 1.0.x to 1.1.x.
In order to make Rails app return json without specyfing extension in URL for Angular 1.1.x you need to make angular add additional header to http request:
myModule.config(['$httpProvider', function ($httpProvider) { $httpProvider.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; }]);
Without that Rails by default renders whole HTML instead of returning JSON.
Github issue reflecting that
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With