angularjs 指令初级问题

下面的代码运行错误了?为什么?版本问题吗?怎么兼容


<!DOCTYPE html>
<html ng-app = 'myApp'>
<head>
  <meta charset="UTF-8">
  <title></title>
  <link href="https://cdn.bootcss.com/bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
 
  <Lee></Lee>

  <script src="https://cdn.bootcss.com/angular.js/1.5.0/angular.min.js"></script>
  <script src="https://cdn.bootcss.com/angular-ui-router/1.0.0-alpha0/angular-ui-router.min.js"></script>
  <script type="text/javascript">
    var myApp = angular.module("myApp",[]);
    myApp.directive('Lee',  function(){
        // Runs during compile
      return {
         restrict: 'A', // E = Element, A = Attribute, C = Class, M = Comment
         template: '<div>My Name Is Lee</div>',
         replace: true
      };
    });
  </script>
</body>
</html>

qq_亚里士多德的猫_0
浏览 1423回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP