站内搜索:
首页 >> 前端 >> 内容
简单的angular实例

时间:2017/2/17 9:24:09

创建一个简单的angular实例


显示当前系统时间

<script id="others_angular_103" type="text/javascript" class="library" src="/js/sandbox/other/angular.min.js"></script>
    
    

当前时间:{{colok.now}};

        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();

    }

  • 上一篇:编码中的setCharacterEncoding理解
  • 下一篇:Bootstrap--BootstrapDialog
  • 返回顶部