为什么单击按钮时警报会显示两次?

use*_*513 12 require angularjs angularjs-directive angularjs-scope ionic-framework

你能否告诉我为什么警告在点击按钮时会显示两次?

这是我的傻瓜 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")
        };

    }]);

});
Run Code Online (Sandbox Code Playgroud)

Mos*_*ham 1

如果您使用较新版本的 Ionic,它可以工作: http://plnkr.co/edit/K2BLrUyOEeoDxHc9LyTl ?p=preview

我使用http://code.ionicframework.com/1.0.0/js/ionic.bundle.min.js

您的示例使用 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'
]
Run Code Online (Sandbox Code Playgroud)

});