index.js 842 字节
Newer Older
Y
Your Name 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
(function () {
    'use strict';
    angular.module('eolinker')
        .component('menuRadioCommonComponent', {
            templateUrl: 'app/component/menuRadio/index.html',
            controller: indexController,
            bindings: {
                output: '=',
                list: '<',
                modelKey: '@',
                bindFun: '&',
                cancelBindFun:'@',
                disabled:'<'
            }
        })

    indexController.$inject = [];

    function indexController() {
        var vm = this;
        vm.fun = {};
        vm.fun.clickMenu = function (inputValue) {
            if (!vm.cancelBindFun) {
                vm.bindFun({
                    arg: inputValue
                });
            } else {
                vm.output[vm.modelKey] = inputValue;
            }
        }
    }
})();