AngularJs - How do I create one variable/one input that would be used in multiple controllers?
<p>I need help with syntax.</p>

<p>I'm trying to create 2 user inputs stored as variables, that would be used within 3 separate controllers.</p>

<p>What I'm trying to do is create a table where each row is a controller in itself. Based on the numbers the user inputs, each row would calculate various fields. </p>

<p>'Standard Eye Level' and 'ImageAspectRatio' need to go into each of the three controllers but I'm not sure what the correct syntax would be.</p>

<p>Please take a look at my plunkr: <a href="https://plnkr.co/edit/ptHhwmaKdeB4CfYEvdlL?p=preview" rel="nofollow noreferrer">https://plnkr.co/edit/ptHhwmaKdeB4CfYEvdlL?p=preview</a></p>

<pre><code>var BDMApp = angular.module('BDMApp', []);
var StandardEyeLevel = Number(ctrl.StandardEyeLevel || 0);
var ImageAspectRatio = Number(ctrl.ImageAspecRatio || 0);

BDMApp.controller('BDMFarViewController', [function() {
var ctrl = this;
ctrl.BDMCalc = function() {
  var BDMFarViewImgHeight = Number(ctrl.BDMFarViewImgHeight || 0);
  var BDMFarViewDistFloor = Number(ctrl.BDMFarViewDistFloor || 0);
  var BDMFarViewMinPerElm = Number(ctrl.BDMFarViewMinPerElm || 0);
  ctrl.BDMFarViewImgOffSetAns = BDMFarViewDistFloor - StandardEyeLevel;
  ctrl.BDMFarViewImgWidthAns = BDMFarViewImgHeight * ImageAspectRatio;
  ctrl.BDMFarViewFarViewAns = BDMFarViewDistFloor * BDMFarViewMinPerElm * 200;
  ctrl.BDMFarViewViewRatAns = ctrl.BDMFarViewFarViewAns / BDMFarViewDistFloor;
  ctrl.BDMFarViewVVFAns = BDMFarViewDistFloor + ctrl.BDMFarViewImgOffSetAns;
  ctrl.BDMFarViewCloseViewAns = ctrl.BDMFarViewVVFAns * 1.732;
  ctrl.BDMFarViewViewRatAns = ctrl.BDMFarViewCloseViewAns / BDMFarViewImgHeight;
  ctrl.BDMFarviewNominalViewDepthAns = ctrl.BDMFarViewFarViewAns - ctrl.BDMFarViewCloseViewAns;
}
}]);
</code></pre>

<p>Any and all help is appreciated.</p>