Use $window to access global JSON lib