I am currently working on an Angular application that utilizes Firebase as its backend. My goal is to inject 'toaster' as a dependency within my authorization app factory. Below is the initial setup of the app.factory:
app.factory('principal', ['$rootScope',
'$q', '$http', '$timeout', '$firebaseAuth', "$firebaseObject", '$filter','$firebaseArray', '$state', 'toaster'
function ($rootScope, $q, $http, $timeout, $firebaseAuth, $firebaseObject, $filter, $firebaseArray, $state, toaster)
However, when configured this way, the application fails to load. While I am able to use 'toaster' in my controllers without any issue, incorporating it into a factory causes my application to break. As a newcomer to Angular, I am unsure if I have overlooked something crucial or if adding such a dependency to a factory is the wrong approach.
My main objective is to implement a simple toaster pop-up to notify users of an incorrect password input. Would it be advisable to create a separate controller specifically for handling this task?