angular-jsdoc - How to desribe $broadcast

116 Views Asked by At

I have a service named 'utils'. This service have some methods.

Also, this service fire 2 broadcasts: "authUtilsFailed" and "authUtilsLoaded".

How can I document those 2 broadcasts ? (Using angular-jsdoc)

angular.module('myApp')
    .service('utils', function ($http,$rootScope) {

        $http.get("api/Identity/").success(function (data) {
            try {
                data = JSON.parse(JSON.parse(data));
                self.uniqueId = data.id;
                self.displayName = data.displayName;
                $rootScope.$broadcast('authUtilsLoaded');
            }
            catch (err){
                $rootScope.$broadcast('authUtilsFailed');
            }
        }).error(function (error) {
            $rootScope.$broadcast('authUtilsFailed');
        });
    });

Thanks,

kfir.

0

There are 0 best solutions below