Here is some HTML code snippet:
<tab id="briefcase" ng-controller="BriefcaseController as vm" active="main.uiState.briefcaseOpen">
<tab-heading>
<i class="glyphicon glyphicon-briefcase"></i><br>
My Court Cases <span id="briefcaseCount" ng-show="main.briefcase.contents.length" class="badge">{{main.briefcase.contents.length}}</span>
</tab-heading>
<ng-include src="'app/components/briefcase/briefcase.html'"></ng-include>
</tab>
I referred to the protractor API example for guidance, like this:
<span id="foo">{{variableInScope}}</span>
And then used this code snippet:
var value = element(by.id('foo')).evaluate('variableInScope');
In my case, I had multiple instances with the same expression, so I modified it as follows:
var value = element.all(by.id('briefcaseCount')).get(0).evaluate('main.briefcase.contents.length');
When I tried to fetch console.log(value)
, it returned [object, Object]. Any assistance on this would be greatly appreciated.