Use $scope instead of scope in directives

This commit is contained in:
Blade Barringer
2015-08-22 16:59:35 -05:00
parent 5e510aade0
commit 6b7ca3e823
8 changed files with 23 additions and 22 deletions

View File

@@ -1,5 +1,6 @@
'use strict';
var count = 0;
(function(){
angular
@@ -9,10 +10,10 @@
function expandMenu() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
link: function($scope, element, attrs) {
element.on('click', function(event) {
scope._expandedMenu = (scope._expandedMenu == attrs.menu) ? null : attrs.menu;
scope.$apply()
$scope._expandedMenu = ($scope._expandedMenu === attrs.menu) ? null : attrs.menu;
$scope.$apply()
});
}
}