Access an variable from outside angular controller
<p>I'm using <a href="http://timetablejs.org/" rel="nofollow">timetable.js</a> together with an angular router and firebase for the backend. My code looks like this: </p>

<p>That is the html file that angular routes to:</p>

<pre><code>&lt;div class="timetable" ng-init="initTimetable()"&gt;&lt;/div&gt;
</code></pre>

<p>That's the file where I handle all my functions from that router:</p>

<pre><code>myApp.controller('myController', function($scope) {

    $scope.initTimetable = function() {
        var timetable = new Timetable();
        timetable.setScope(8, 14); 

        timetable.addLocations(['Place 1', 'Place 2', 'Place 3']);

        timetable.addEvent('Homework', 'Place 1', new Date(2016,9,10,11,45), new Date(2016,9,10,12,30));

        var renderer = new Timetable.Renderer(timetable);
        renderer.draw('.timetable');
     };
});
</code></pre>

<p>What I'm now trying to do is to run that <strong>timetable.addEvent()</strong> function outside that controller.</p>

<p>I hope somebody understood, what I'm trying to do and can help me. </p>

<p>Thanks!</p>