Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the alert displayed two times on button click?

Could you please tell me why alerts display two times on button click?

here is my plunker http://plnkr.co/edit/vtmYAG2d1gmnPjnxovJw?p=preview

/*global define, console */

define(['app'], function(app){
   'use strict';

    app.controller('LoginCtrl', ['$scope', function($scope) {
        $scope.login = function () {
          alert("Login is clicked")
        };

    }]);

});
like image 769
user944513 Avatar asked Jun 25 '15 05:06

user944513


1 Answers

If you use a newer version of Ionic it works: http://plnkr.co/edit/K2BLrUyOEeoDxHc9LyTl?p=preview

I used http://code.ionicframework.com/1.0.0/js/ionic.bundle.min.js

your example uses http://code.ionicframework.com/1.0.0-beta.1/js/ionic.bundle.min.js

requirejs.config({
paths: {
    ionic:'http://code.ionicframework.com/1.0.0/js/ionic.bundle.min',
},
shim: {
    ionic : {exports : 'ionic'}
}, priority: [
    'ionic'
],

deps: [
    'bootstrap'
]

});

like image 118
Moshe Shaham Avatar answered Oct 17 '22 17:10

Moshe Shaham