i having trouble setting values widget making. using ozone widget framework, part negligible discussion. here html trying set variable (for focus on {{user.user}}
part.
<div class="col-lg-12"> <p>user: {{user.user}}</p> <table class="table table-bordered table-hover table-striped"> <thead> <th>#</th> <th>model</th> <th>score</th> <th>date</th> </thead> <tr data-ng-repeat=" item in records | orderby : '-score' | limitto : 10 " ng-click=""> <td>{{$index+1}}</td> <td>{{item.model}}</td> <td>{{item.score}}</td> <td>{{item.date}}</td> </tr> </table> </div>
and here angular / owf go it:
angular.module('myapp', ['cgowf']) .controller('mainctrl', function($scope, $http, owf) { var records; $scope.selectpost = ''; $scope.searchtext = ''; console.debug("before here!!!"); owf.ready(function(){ console.debug("made here!!!"); owf.eventing.subscribe('user-status', function(sender, msg, channel) { console.debug('[%s] - received message %o', channel, msg); $scope.user = msg; }); }); $scope.search = function() { //clear select, go here http://jsonplaceholder.typicode.com/comments //and display/filter emails based on search input $scope.selectpost = ""; $scope.selecteditem = null; $http.get('https://api.myjson.com/bins/1jvst').success(function(data2) { $scope.records = []; data2.foreach(function(r) { if (r && r.user && r.user.tolowercase().indexof($scope.searchtext.tolowercase()) !== -1) { $scope.records.push(r); } }); }); }; });
the part having trouble $scope.user = msg;
. @ point in code, msg
json object, , sure of because checks out in js debugger in chrome. afaik how set object access in html, though doesn't work.
the owf
event isn't triggering $digest
cycle, view never updates. can run $scope.apply()
force $digest
owf.eventing.subscribe('user-status', function(sender, msg, channel) { console.debug('[%s] - received message %o', channel, msg); $scope.$apply(function() { $scope.user = msg; }); });