angular-timer icon indicating copy to clipboard operation
angular-timer copied to clipboard

var app = angular.module('timer');

Open FDiskas opened this issue 10 years ago • 1 comments

What if I already have this var? You will rewrite this. I suggest you extend it.

In my case I have in mane layout header

<script>
        window.app = window.app || {};
        window.app.videoApp = window.app.videoApp || {};
        window.app.videoApp.api = 'world';
</script>

And my main application is something like this:

(function (app) {
    'use strict';

    app.videoApp = angular.extend(angular.module('App', []), app.videoApp);

    /* Controllers */
    app.videoApp
        .controller(
            'mainCtrl',
            [ '$scope', function ($scope) {

                  $scope.getDemo = function () {
                    return 'Hello ' + app.videoApp.api;
                  };
                }
            ]
        );

})(window.app = window.app || {});

And if I try to call controller method I got undefined I think that problem is here: https://github.com/siddii/angular-timer/blob/master/dist/angular-timer.js#L353-L355

Here is demonstration of this bug: http://jsbin.com/qesalobere/1/edit?html,js,output

p.s. My javascript files are at the bottom of the page

FDiskas avatar Jun 23 '15 11:06 FDiskas

I've just come have the worry. It would be nice to rename this variable too generic.

roukmoute avatar Apr 04 '16 15:04 roukmoute