Assuming moment
is a property of window
, you'll need to create a reference in this object's $scope
that references moment
.
Very simply:
$scope.moment = window.moment;
Here's a plunkr showing internal $scope
methods vs. a $scope
property referencing a method on window
:
http://embed.plnkr.co/PWFK80/preview
That's the simple answer, but you'd likely want to wrap this library into its own directive or service, so that you could use it without coupling higher-level objects to the window object unnecessarily.