While experimenting with different methods for loading an alert on load using angularJS, I came across a particular approach:
JS
$scope.init = function () {
($window.mockWindow || $window).alert('Hello');
};
HTML
<div data-ng-controller="myCtrl" data-ng-init="init()">
<span id="logo">Just a</span><span id="small" >PREVIEW</span>
</div>
An issue arises where I encounter the following error:
Uncaught ReferenceError: $scope is not defined
I need help to identify and correct the mistake in my implementation. Can someone assist me, please?