[AngularJS] Transclude -- using what existing in DOM to replace the template elements in directive
-- to in The Using dom angularjs Template
2023-09-14 08:59:21 时间
var app = angular.module("phoneApp", []); app.controller("AppCtrl", function($scope) { }); app.directive("panel", function() { return { restrict: "E", transclude: true, template: '<div class="panel" ng-transclude>This is a panel component</div>' } })
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title>Angular Scope &</title> <link href="foundation.min.css" rel="stylesheet"/> <script src="angular.min.js"></script> <script src="app.js"></script> </head> <body > <div ng-app="phoneApp"> <div ng-controller="AppCtrl"> <panel> <div class="button">Click me!</div> </panel> </div> </div> </body> </html>
相关文章
- C#编写媒体播放器--Microsoft的Directx提供的DirectShow组件,该组件的程序集QuartzTypeLib.dll.
- iOS开发之SQLite--C语言接口规范(三)——Binding Values To Prepared Statements
- iOS之UI--CAGradientLayer
- [systemd]How To Use Systemctl to Manage Systemd Services and Units
- 前端学习 -- 超链接
- bug--Unable to add window –token is not valid; is your activity running?
- [Javascript] Broadcaster + Operator + Listener pattern -- 27. combine multi broadcaster and compose operator to implement game logic
- [Intro to Deep Learning with PyTorch -- L2 -- N20] Cross-Entropy
- [Intro to Deep Learning with PyTorch -- L2 -- N14] Sigmoid function
- [Algorithm -- Dynamic programming] 91. Decode Ways <How Many Ways to Decode This Message?>
- [Angular HTML] Implementing The Input Mask Cursor Navigation Functionality -- setSelectionRange
- [MEAN Stack] First API -- 5. Using $resource to setup REST app
- Linux--YUM 安装 nginx php mysql
- sql基础--怎样查询所有列数据
- C#--SelectedIndexChanged事件, SelectedValueChanged事件和SelectionChangeCommitted事件的区别及联系
- dialog--not attached to window manager
- POI导出Excel--合并单元格
- [Javascript] Broadcaster + Operator + Listener pattern -- 10. Define a Function to Set Common Behaviors in Operators
- [MEAN Stack] First API -- 7. Using Route Files to Structure Server Side API
- [MEAN Stack] First API -- 5. Using $resource to setup REST app
- MyCat实战--读写分离/数据分片/mycat集群/haproxy负载均衡
- Etcd故障排除--recovering backend from snapshot error: failed to find database snapshot file (snap: snaps
- 【Codeforces 231C】To Add or Not to Add
- 成功解决absl.flags._exceptions.IllegalFlagValueError: flag --train_size=inf: Expect argument to be a str
- 解密昇腾AI处理器--DaVinci架构(计算单元)
- 深入理解 C 指针阅读笔记 -- 第五章
- Etcd故障排除--recovering backend from snapshot error: failed to find database snapshot file (snap: snaps
- 数字IC手撕代码--投票表决器
- 【Deepin 20系统】解决Error: unsupported compiler: 8.3.0. Use --override to override this check.
- 设计网站中的精品,你可能需要它--第四期
- 强化学习笔记:策略评估--贝尔曼方程求解示例