Angular Factory Application Toaster as an application for decomposition of dependencies

I have an angular application using Firebase as a backend, and I'm trying to add a toaster as a dependency in my factory authorization application. Here is the start of 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)

With this configuration, the application simply does not load. I can use the toaster inside my controllers, but inside the factory it crashes my application. I am new to angular, so I don’t know if I am missing something or completely abandoned the base to add such a dependency to the factory.

I need a simple toaster to prevent the wrong password. Should I just create a separate controller for this?

+4
source share
1 answer

toaster , .

<toaster-container 
toaster-options="{'time-out': 3000, 'animation-class': 'toast-top-center'}">
</toaster-container>
+3

All Articles