AngularJS基本功能

来源:互联网 发布:oracle sql书写技巧 编辑:程序博客网 时间:2024/05/29 03:20
// 创建模块var myApp = angular.module("myApp", []);// 创建控制器myApp.controller("myCtrl", function($scope) {    $scope.msg = "ok";});// 创建过滤器myApp.filter("myFilter", function() {    return function(input) {        return input.toUpperCase();    }});// 创建指令myApp.directive("myDctv", function() {    return function(scope, element, attrs) {        element.bind("mouseenter", function() {            element.css("background", "yellow");        });                    element.bind("mouseleave", function() {            element.css("background", "none");        });                }});

0 0
原创粉丝点击