Skip to content

Instantly share code, notes, and snippets.

@brycepj
Created January 19, 2015 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brycepj/8199745d8c7aeeebd4d4 to your computer and use it in GitHub Desktop.
Save brycepj/8199745d8c7aeeebd4d4 to your computer and use it in GitHub Desktop.
scope problemz
When I inspect the scope `in_labor` equals true. So why is it making the ng-if evaluate to false?
(When I remove in_labor it evaluates to true and displays the .panel)
```
.panel.labor-alert(ng-controller='LaborAlertCtrl' ng-if='apps.KEARTH && laborAlert.show && in_labor')
.panel-body
p
strong In labor: {{ in_labor }}
p
a(href='http://google.com') Continue Labor Flow sheet
//- a(sref="'top.episode.ehr.encounters.1.labor'" href) Continue Labor Flowsheet
button.btn.btn-link.pull-right(ng-click='laborAlert.show=false')
i.fa.fa-close.fa-2x
```
```
.controller('LaborAlertCtrl', function($scope, ehrContext, ehrApi) {
var get_episode = ehrContext.get_episode();
get_episode.then(function(episode) {
ehrApi.call("labor_check/in_labor", {episode:episode}).then(function(status) {
$scope.in_labor = status;
});
});
});
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment