How to get contact id of logged-in user in JS API
In case of an angular page use something like

function myext_civicrm_angularModules(&amp;$angularModule) {
  [...]
  $session =&amp; CRM_Core_Session::singleton();
  drupal_add_js(array('CurrentCiviUid' =&gt; $session-&gt;get('userID')), 'setting');
  [...]
}


and access it in JS:

var uid = Drupal.settings.CurrentCiviUid;