简单的angular实例

来源:互联网 发布:解决json包含html标签 编辑:程序博客网 时间:2024/06/05 22:07

创建一个简单的angular实例


                         显示当前系统时间
<script id="others_angular_103" type="text/javascript" class="library" src="/js/sandbox/other/angular.min.js"></script>    </head>    <body ng-app>            <p ng-controller="colokcontroller">                当前时间:{{colok.now}};            </p>    </body>
        function colokcontroller($scope){        var updatecolok=function(){            $scope.colok={now:new Date()};            var updataColok=function(){            $scope.colok.now=new Date();            }            setInterval(function(){                $scope.$apply(updataColok);            },1000);        };        updatecolok();    }
0 0
原创粉丝点击