[email protected]一个最简单的指令demo

<!DOCTYPE HTML>
<html ng-app="app">
<head>
    <title>custom-directive</title>
    <meta charset="utf-8">    
    <link rel="stylesheet" href="../css/bootstrap.css">
    <script src="../js/angular.js"></script>
</head>
<body>
<!-- 下面是自定义指令最简单的demo. -->
<div>
    <hello></hello>
</div>
<script>
var myModule = angular.module("app",[]);
myModule.directive(‘hello‘,function(){//声明一个指令hello标签,替换它的模板是<div>Hi there</div>.反过来也可以说是hello标签表示<div>Hi there</div>这一串html模板代码
    return {
        restrict:‘AE‘,
        replace:true,
        template:‘<div>Hi there</div>‘
    }
});
</script>
</body>
</html>

时间: 2024-10-15 18:11:17

[email protected]一个最简单的指令demo的相关文章

[email&#160;protected]一个高效的配置管理工具--Ansible configure management--翻译(六)

无书面许可请勿转载 高级playbook Finding files with variables All modules can take variables as part of their arguments by dereferencing them with {{ and }} . You can use this to load a particular file based on a variable. For example, you might want to select a

[email&#160;protected]一个高效的配置管理工具--Ansible configure management--翻译(七)

如无书面授权,请勿转载 Larger Projects Until now, we have been looking at single plays in one playbook file. This approach will work for simple infrastructures, or when using Ansible as a simple deployment mechanism. However, if you have a large and complicated

[email&#160;protected]一个高效的配置管理工具--Ansible configure management--翻译(四)

无书面许可请勿转载 由于第三章内容较长,我将分做几个部分来翻译. Advanced Playbooks So far the playbooks that we have looked at are simple and just run a number of modules in order. Ansible allows much more control over the execution of your playbook. Using the following techniques

[email&#160;protected]一个高效的配置管理工具--Ansible configure management--翻译(九)

如无书面授权,请勿转载 第四章 大型项目中Ansible的使用 New features in 1.3 There are two features in Ansible 1.3 that were alluded to previously in the chapter. The first feature is the metadata roles. They allow you to specify that your role depends on other roles. For ex

[email&#160;protected]一个高效的配置管理工具--Ansible configure management--翻译(十)

无书面许可,请勿转载 Custom Modules Until now we have been working solely with the tools provided to us by Ansible. This does afford us a lot of power, and make many things possible. However, if you have something particularly complex or if you find yourself u

[email&#160;protected]一个高效的配置管理工具--Ansible configure management--翻译(十一)

无书面授权,请勿转载 第五章 自定义模块 Using a module Now that we have written our very first module for Ansible, we should give it a go in a playbook. Ansible looks at several places for its modules: first it looks at the place specified in the library key in its con

[email&#160;protected]一个高效的配置管理工具--Ansible configure management--翻译(十二)

如无书面授权,请勿转载 第五章 自定义模块 External inventories In the first chapter we saw how Ansible needs an inventory file, so that it knows where its hosts are and how to access them. Ansible also allows you to specify a script that allows you to fetch the inventor

Ansi[email&#160;protected]一个高效的配置管理工具--Ansible configure management--翻译(五)

无书面许可请勿转载 高级Playbook Extra variables You may have seen in our template example in the previous chapter that we used a variable called group_names . This is one of the magic variables that are provided by Ansible itself. At the time of writing there a

[email&#160;protected]一个简单的UI-Router路由demo

1.index.html: <!DOCTYPE HTML><html ng-app="routerApp"><head>    <title>UI-Router路由demo</title>    <meta charset="utf-8">        <link rel="stylesheet" href="../framework/bootstrap-3