<div my-directive my-url="http://google.com" my-link-text="Click me to go to Google"></div>
angular.module('myApp', []) .directive('myDirective', function() { return { restrict: 'A', replace: true, scope: { // isolate scope myUrl: '@', // binding strategy myLinkText: '@' // binding strategy }, template: '<a href="{{myUrl}}">' + '{{myLinkText}}</a>' } })
myUrl: '@' expects my-url
if we want to use another attribute value, eg. some-attr, we can change to
myUrl: '=someAttr'
相关推荐
A directive is a way to give special instructions to the container at page translation time. The page directive is written on the top of the jsp page. Html tags in jsp In this example we have used ...
On the other hand, you must include the header file for Foo if your class subclasses Foo or has a data member of type Foo. Sometimes it makes sense to have pointer (or better, scoped_ptr) members ...
Chapter One Chapter One - Data Representation 1.0 - Chapter Overview 1.1 - Numbering Systems 1.1.1 - A Review of the Decimal System 1.1.2 - The Binary Numbering System 1.1.3 - ...
Output buffering is a mechanism for controlling how much output data ; (excluding headers and cookies) PHP should keep internally before pushing that ; data to the client. If your application's ...
- FIX: Removed FG_NEWTEXTROTATE directive (the TFlexText Precise mode should be used instead). - FIX: The TFlexRegularPolygon object clones incorrectly drawed in case when TFlexRegularPolygon have ...
2.4.1 Verilog’s timescale directive............................................................................28 2.4.2 Time values with time units ......................................................