I'm having trouble accessing the sourcePath in the controller $scope.
This is the code I have:
(function() {
var sourcePath;
sourcePath = 'app/assets/javascripts/shared/controllers/some_controller.coffee';
angular.module("shared").controller("SomeController", function($scope) {
// $scope._sourcePath = sourcePath;
}).call(this);
However, this $scope._sourcePath = sourcePath;
line.
Manually adding it to a controller works, but I want to reference the sourcePath variable after the controller has been defined.
I want to do
angular.element(someElement).scope().somehowGetThisSourcePathVariable()
In essence, I am trying to access the controller context(this) when I have the $scope object of some controller.
Is there a way to achieve this?