Wednesday, November 9, 2016

custom filter $scope not defined


http://stackoverflow.com/questions/17596246/access-scope-variables-from-a-filter-in-angularjs

app.controller('AppController',
    function($scope) {
      $scope.var1 = 'This is some text.';
      $scope.var2 = 'And this is appended with custom filter.';
    }
  );


app.filter('filterReceiptsForDate', function () {
  return function (input, scope) {
    return input + ' <strong>' + scope.var2 + '</strong>';
  };
});

ng-repeat orderBy

| orderBy:'displayOrder'

gui call microservice

http request (GUI) to micro service (node js )

             _request.getJSON("/cfaes", request, bodyObj, function (rqstId, data, err) {


Service.prototype.UpdateScopeOfAudienceBulk = function(req, res, next) {

when done everything, need to return to GUI
put results in req.result

req.result = {};
req.result.count = count;
next(); // this will return back to GUI from micro service

confusing part is "next" is kind of corresponding to err

Tuesday, November 8, 2016

Convert array to JSON

http://stackoverflow.com/questions/2295496/convert-array-to-json

http://stackoverflow.com/questions/191881/serializing-to-json-in-jquery

var myJsonString = JSON.stringify(yourArray);
var jsonArray = JSON.parse(JSON.stringify(pluginArrayArg))

Monday, November 7, 2016

moongoose bulk update


http://codingmiles.com/nodejs-bulk-update-to-mongodb-using-mongoose/

http://blog.mongodb.org/post/84922794768/mongodbs-new-bulk-api

Wednesday, November 2, 2016

move array element



http://stackoverflow.com/questions/5306680/move-an-array-element-from-one-array-position-to-another