Angular 测试

by lxjwlt

HTML

<script src="http://cdn.bootcss.com/angular.js/1.3.0-beta.8/angular.min.js"></script>
<div ng-app="myApp" ng-controller="someCtrl">
    <script type="text/ng-template" id="demo.html">
        <h1>Title</h1>
        <p>content put here</p>
    </script>
    <hero flavor="lxjwlt">something</hero>
</div>

CSS

.panel {
    color: red;
}

JavaScript

var app = angular.module("myApp", []);

app.controller('someCtrl', function($scope) {

});

app.directive('hero', function($templateCache) {
    return {
        restrict: "E",
        replace: true,
        template: $templateCache.get('demo.html'),
        link: function(scope, elem) {
            
        }
    };
});