<h1>Example: ngMousedown / ngMouseup</h1>
<p>ngMousedownはMousedownイベント、ngMouseupはMouseupをリスナー登録します。</p>
<div ng-app="myApp">
  <div ng-controller="myController">
    <p ng-mousedown="mousedown()" ng-mouseup="mouseup()" ng-style="myStyle" ng-class="'button'">Mousedownするとフォントが太くなります。(クリックしてください)</p>
  </div>
</div>
@import "bourbon";

body {
  padding: 1.5rem;
}

.button {
  padding: .5em;
  border: 1px solid #ccc;
}
View Compiled
var app = angular.module('myApp', []);

app.controller('myController', ['$scope', function($scope){
  $scope.mousedown = function(){
    $scope.myStyle = {
      fontWeight: 'bold',
      background: '#ccc'
    };
  }
  
  $scope.mouseup = function(){
    $scope.myStyle = {
      fontWeight: 'normal',
      background: 'none'
    };
  }
}]);

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js