### controllerAs的使用
- 正常设置scope对象的参数,bindToController参数值改为true
'use strict';
angular.module('nodeInAction')
.directive('countCard', function () {
return {
restrict: 'E',
scope: {
icon: '@',
title: '@',
count: '@',
unit: '@',
colorStyle: '@'
},
controllerAs: 'vm',
bindToController: true,
templateUrl: 'app/components/countCard/countCard.html',
controller: function () {
var vm = this;
console.log(vm);
}
};
});