Swiip / generator-gulp-angular

Yeoman generator for AngularJS with GulpJS [UNMAINTAINED next iteration is FountainJS]

Home Page:http://fountainjs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

migrate from angular 1 to 5

falahatiali opened this issue · comments

hi alex.
i want implement project in angular 5. but i cant implement for example alert service that you write by animate.css. how i can convert following code to angular cli ?

       angular.module('clientApp').service('alert', function alert($rootScope, $timeout) {

     var alertTimeout;

     return function (type, title, message, timeout) {
        $rootScope.alert = {
            hasBeenShown: true,
          show: true,
          type: type,
          message: message,
          title: title
        };

       $timeout.cancel(alertTimeout);
       alertTimeout = $timeout(function () {
         $rootScope.alert.show = false;
       }, timeout || 3000);
   }
 });

Close this issue please, angular 1(js) ≠ angular 2 (typescript)