Thursday, June 30, 2016

ng-repeat alter class



<div ng-class-odd="'cfaesProfile_row'" ng-class-even="'cfaesProfile_row_alt'">

Wednesday, June 29, 2016

clear html and append



 var buildTable = function ($scope, table) {
      var div = module.buildTable(table);
      var to = $scope.div.find("#table");
      to.empty();
      //to.html();
      to.append(div);
    };

CSS


https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_Started/Why_use_CSS

item page page


itemsPerPage MUST be declared after the filter(s) or else you will experience unexpected behavior.

Like so:


<tr dir-paginate-start="c in cthings | filter:x | itemsPerPage: 5" >

Monday, June 27, 2016

ng-class

bottom of page example

https://docs.angularjs.org/api/ng/directive/ngClass

use class depending scope value, example below: status changes then class is used


<li id="view" class="tab-action-element" 
   ng-class="(status =='profile') ? 'my-class' : ''" 
>Profile
</li>

skype conference

https://community.spiceworks.com/topic/477673-mic-solution-for-skype-in-large-conference-room

Saturday, June 25, 2016

Wednesday, June 22, 2016

grunt install



  • Open a console and run "npm install -g grunt-cli" so that you can execute grunt

grunt runs in node js command prompt or terminal (in webstorm), cannot run when node js project is running.

Wednesday, June 15, 2016

Mongoose Schema


1. Add schema

Convert MongoDB collection to Moongoose Schema

Tuesday, June 14, 2016

Mongoose $lookup aggregate

Not sure why $match has to be first, also parm has to be converted to number
from is the out side collection, foreignField is also from out side collection. "as" defines name of the result array name.  LocalField is the base collection.

router.get('/person_narrative/person_id/:person_id', function (req, res, next) {
 
  KMPersonNarrative.aggregate([
      {
        $match: {
          person_id: Number(req.params.person_id)
        }
      },
      {
        $lookup: {
          from: "ror_narratives",
          localField: "narrative_id",
          foreignField: "id",
          as: "texts"        }
      }

    ])
    .exec()
    .then(function (allNarratives) {
      res.json(allNarratives);
    });
});

Thursday, June 9, 2016

how to use trello


http://www.timbendt.com/2012/08/using-trello-for-organization-ministry-work-life/

Thursday, June 2, 2016

add to class using javascript



http://stackoverflow.com/questions/2221160/how-to-change-a-css-class-style-through-javascript

increase space between radio button

http://stackoverflow.com/questions/12294367/html-radio-buttons-add-space-between-the-buttons-from-the-same-groupe
input[type="radio"]{
  margin: 0 10px 0 10px;
}

input[type="radio"]{
      //padding: or margin or line-height for better spaces between radio button according to your need and design;
}

Wednesday, June 1, 2016

ng-repeat skip one value



http://stackoverflow.com/questions/19783816/angular-ng-repeat-skip-an-item-if-it-matches-expression

JavaScript debug

I figured this out by adding console print statements to the functions that were added for page callback and noticed they were continuing to loop. There are only a handful of reasons for a loop to not terminate and it was pretty easy once the loop was clearly terminal as defined. So I back traced the loop variable just reading the code and figured out that it wasn't actually in scope. In the app while looking at the nodes widget, telling the console to print x showed it was changing, which meant it wasn't in any scope and was acting at the root level and thus the reason for the collision. 

html expandable list

http://jasalguero.com/ledld/development/web/expandable-list/