`
yanzhihong23
  • 浏览: 59227 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Passing data into a directive

 
阅读更多

 

<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'

 

 

 

 

 

 

分享到:
评论

相关推荐

    Clustering by Passing Messages Between Data Points

    Clustering data by identifying a subset of representative examples is important for processing sensory signals and detecting patterns in data. Such “exemplars” can be found by randomly choosing an ...

    Designing Data Tier Components and Passing Data Through Tiers

    ### 设计数据层组件与跨层传递数据 在设计分布式应用程序时,如何高效地访问、表示及管理业务数据是至关重要的。本篇文章旨在提供一系列指导原则,帮助开发人员选择最合适的暴露、持久化以及跨应用层传递数据的方法...

    Passing parameters with data reports. I have set two paramet

    Passing parameters with data reports. I have set two parameters and passed them during run time.Open with VB6.

    BizObj.rar_Passing Through

    描述提到的是"Microsoft Designing Data Tier Components and Passing Data Through Tiers",这显然是一个讨论如何在多层架构中设计数据层组件并有效地在各层之间传递数据的教程或指南。 在IT领域,特别是在企业级...

    Android_PassingData

    安卓 入门 要下载并运行该程序,您所需要做的就是按下克隆或下载按钮,然后复制链接。 打开Android Studio并从“版本控制”中转到“文件”-&gt;“新建”-&gt;“项目”-&gt; Github,然后在刚复制的链接中定位。...

    Message Passing Interface (MPI)

    Message Passing Interface (MPI),Message Passing Interface (MPI)

    LDPC message passing 译码算法

    用于LDPC的译码程序,使用message passing 算法,可以选择迭代次数, 调整信噪比,用LLR计算

    JSP Simple Examples

    In jsp we can declare it inside the declaration directive or a scriptlet directive. String Length In java, Strings are objects that belong to class java.lang.String. A string is a sequence of simple...

    Passing Binary Data in COM在COM中传递二进制数据

    在COM(Component Object Model)中,传递二进制数据是一个常见的需求,特别是在处理图像、音频、文件等非结构化数据时。... 首先,让我们来看看`BufferVariant.h`这个文件名,它暗示了一个使用了`VARIANT`类型的缓冲...

    MPI: A Message-Passing Interface Standard - Version 2.2 - Sep.4. 2009

    消息传递接口(Message Passing Interface,简称MPI)是并行计算领域中的一个重要标准,它为编写可移植的并行程序提供了一种方法。MPI 2.2版本是基于之前版本进行改进的结果,主要包含了对原有功能的增强和澄清,并...

    Interest-aware Message-Passing GCN for Recommendat.md

    Interest-aware Message-Passing GCN for Recommendat.md

    AP聚类_Clustering by Passing Messages Between Data Points1

    【标题】:AP聚类(Affinity Propagation)_通过数据点间传递消息进行聚类 【描述】:AP聚类方法是由Brendan J. Frey和Delbert Dueck提出的一种新的数据聚类技术,它着重于寻找数据集中的代表性实例(exemplars),...

    S7A驱动720版本

    - Passing of invalid OPC Item IDs caused a memory leak of the driver's global memory. After the global memory was exhausted, the driver crashed. - Writing of string values failed when using ...

    React-Udacity-Exercise2-PassingData

    该项目是通过引导的。 您将在下面找到一些有关如何执行常见任务的信息。 您可以在找到本指南的最新版本。 目录 更新到新版本 Create React App分为两个包: create-react-app是用于创建新项目的全局命令行实用程序...

    Web Microanalysis of Big Image Data

    4.4.4 Web server side Message Passing Interface. 12 4.4.5 Web server side Network File System.. 14 4.5 Designing interactive user interfaces in web browsers. 14 4.5.1 Design pattern for code ...

    Exam Ref 70-761 Querying Data with Transact-SQL

    Passing this exam earns you credit toward a Microsoft Certified Solutions Associate (MCSA) certification that demonstrates your mastery of essential skills for building and implementing on-premises ...

    Cold atoms passing through a thin laser beam: a Fourier optics approach

    In this report, we adopt it to investigate the kinetic behavior of cold atoms passing through a far red-detuned Gaussian beam. We demonstrate that the aberration has significant influence on the ...

Global site tag (gtag.js) - Google Analytics