Except if I use that, it seems to break my binding. The first fetch
modifies the list and populates the template, yet using isolateScope() to
access fetchNextPage() seems to only modify listItems internally and my
template doesn't update
scope.fetchNextPage = function () {
loadListItems();
};
scope.resetList = function(){
listPage = 0;
scope.listItems = [];
};
var loadListItems = function(){
if(fetching===true)return;
fetching = true;
scope.loadListDelegate({ params: { listPage: listPage }, success:
addItems, error: handleError });
};
var addItems = function(items){
fetching = false;
listPage++;
scope.listItems = scope.listItems.concat(items);
console.log(scope.listItems);
};
loadListItems();
//////////////////////////////////////Test
it('Appends the list', function () {
el.isolateScope().fetchNextPage();
expect(el.find('li').length).toBe(30);
});
On Wednesday, 15 January 2014 10:52:05 UTC, kyma wrote:
>
> Oh .isolateScope() Thanks internet :-)
>
> On Wednesday, 15 January 2014 10:45:40 UTC, kyma wrote:
>>
>> I'm testing a directive with isolated scope. How can I access the scope
>> methods in my jasmine tests?
>>
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.