Home>Article>Web Front-end> Angularjs customizes an input drop-down box component (code example)

Angularjs customizes an input drop-down box component (code example)

青灯夜游
青灯夜游 forward
2020-12-24 17:50:09 2689browse

The following article will introduce to youAngularjsHow to customize an input drop-down box component. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

Angularjs customizes an input drop-down box component (code example)

Related recommendations: "angularjs tutorial"

Customize an input drop-down box component in angularjs, and create the component and introduced as follows.

New insertSelect.html file

  

directive Custom directive

//可输入select框 angular.module("controllers") .directive("insertSelect", [function () { return { restrict: 'AE', templateUrl: 'template/common/insertSelect.html', scope: { modelData: '=modelData', optionList: '=optionList', placeholder: '=placeholder', //placeholder 可由引入页面传入 }, link: function ($scope, $elem) { // }, controller: ["$scope", function ($scope) { }] } }]);

The page introduces the insertSelect component

 

For more programming-related knowledge, please visit:Programming Teaching! !

The above is the detailed content of Angularjs customizes an input drop-down box component (code example). For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete