角指令自定义选择/下拉列表 [英] Angular directive for custom select/dropdown

查看:103
本文介绍了角指令自定义选择/下拉列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图创建指令主要选择定制组件,使用不同类型的数据。例如国家数据,数据的选项,等等。

I'm trying to create a directive main custom select component, which use different types of data. e.g. Country data, Options data, etc.

问题是,我不知道什么是'角的方式要做到这一点,因为我想知道,如果该数据应在另一个文件(使用范围或不呢?),然后从使他们不知何故该指令。如果有人可以对带来一些光,将是超级有益的,我会非常AP preciative!非常感谢!

The thing is that I don't know what is the 'Angular way' to do that, since I'm wondering if the data should be in another file (using scope or not?), and then rendering them somehow from the directive. If someone can bring some light on that, would be super helpful and I'd be very appreciative! Thanks a lot!!

推荐答案

有一个看看这个多选下拉指令我写的。 IMO学角度指令的最好方法就是开始瞎搞写你自己的。 也是一个很好的文章。

Have a look at this multiselect dropdown directive I wrote. IMO the best way to learn angular directives is just to start messing around writing your own. This is also a good article.

这篇关于角指令自定义选择/下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆