HLJ 发布于
2018-08-15 15:17:07

AngularJS ng-cut, ng-copy, ng-paste事件与示例

上一篇文章:

AngularJS $watch()函数

html代码:
<body>
  <div ng-app="ngcopyApp" ng-controller="ngcopyCtrl">
    <h2>AngularJS ng-copy,paste,cut事件示例</h2>
    复制文本: <input type="text" ng-copy="copytext=true" value="Hi, Welcome to Tutlane" /> <br />
    <span>操作状态:<b>{{copytext}}</b></span><br />
    剪切文本: <input type="text" ng-cut="cuttext=true" value="Hi, Welcome to Tutlane" /> <br />
    <span>操作状态:<b>{{cuttext}}</b></span><br />
    粘贴文本: <input type="text" ng-paste="pasttext=true" /> <br />
    <span>操作状态:<b>{{pasttext}}</b></span>
  </div>
</body>
JavaScript代码:
<script type="text/javascript">
var app = angular.module('ngcopyApp', []);
app.controller('ngcopyCtrl', function ($scope) {
  $scope.cuttext = false;
  $scope.copytext = false;
  $scope.pasttext = false;
});
</script>
当前文章内容为原创转载请注明出处:http://www.good1230.com/detail/2018-08-15/99.html
最后生成于 2024-05-27 22:52:57
上一篇文章:

AngularJS $watch()函数

此内容有帮助 ?
0