Ok so this is actually mostly a duplicate of Why ng-hide doesn't work with custom directives?
Because you're creating a new scope in your directive you have to pass the variable noSecond to the directive and include it in the new scope.
Also - you should really use camelCase for your javascript:
JS:
function Ctrl3($scope) {
$scope.noSecond = true;
};
var appmod = angular.module('appMod', []);
appmod.directive("mybutton", function() {
return {
restrict: "E",
template: "<div style='border: 1px solid black;'><button>{{label}}</button></div>",
scope: {label:'@', noSecond: '='}
};
});
HTML:
<div ng-app="appMod">
<div ng-controller="Ctrl3">
<button>First</button>
<button ng-hide="noSecond">Second</button>
<mybutton ng-hide="noSecond" label="My button" no-second="noSecond"/>
</div>
</div>
It does appear that this has changed in angular 1.2.1 although I can't seem to find the change in the migration guide that would be responsible for this....