{"id":7438,"date":"2015-03-23T02:31:31","date_gmt":"2015-03-23T06:31:31","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/?p=7438"},"modified":"2016-09-26T18:09:06","modified_gmt":"2016-09-26T22:09:06","slug":"angularjs-%e0%a6%8f-%e0%a6%a8%e0%a6%bf%e0%a6%9c%e0%a7%87%e0%a6%b0custom-directives-%e0%a6%a4%e0%a7%88%e0%a6%b0%e0%a6%bf%e0%a5%a4-building-your-own-directives-in-angularjs","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=7438","title":{"rendered":"AngularJS \u098f \u09a8\u09bf\u099c\u09c7\u09b0\/Custom Directives \u09a4\u09c8\u09b0\u09bf\u0964 building-your-own-directives-in-angularjs"},"content":{"rendered":"<p>AngularJS \u098f\u09b0 \u09ae\u09be\u09a7\u09cd\u09af\u09ae\u09c7 \u09a8\u09bf\u099c\u09c7\u09b0 Directives \u09a4\u09c8\u09b0\u09bf\u0964<br \/>\nMd. Shahinoor Islam\u09a8\u09bf\u099c\u09c7\u09b0 Directives \u09a4\u09c8\u09b0\u09bf\u0964<br \/>\nHTML \u0989\u09aa\u09be\u09a6\u09be\u09a8, \u09ae\u09a8\u09cd\u09a4\u09ac\u09cd\u09af \u09ac\u09be CSS classes \u09a6\u09bf\u09df\u09c7 Directives \u09aa\u09cd\u09b0\u09a6\u09b0\u09cd\u09b6\u09a8 \u0995\u09b0\u09a4\u09c7 \u09aa\u09be\u09b0\u0964 \u0989\u09a6\u09be\u09b9\u09b0\u09a8\u0983<\/p>\n<p>&lt;my-directive&gt;&lt;\/my-directive&gt;<br \/>\n&lt;input my-directive&gt;<br \/>\n&lt;!\u2013 directive: my-directive\u2013&gt;<br \/>\n&lt;input&gt;<\/p>\n<p>\u098f\u0995\u099f\u09bf Directive \u098f\u09b0 \u09a7\u09be\u09b0\u09a8\u09be<br \/>\nangular.module(\u2018app\u2019, []).directive(\u2018myDir\u2019, function() {<br \/>\nreturn myDirectiveDefinition;<br \/>\n});<\/p>\n<p>\u098f\u0995\u099f\u09bf Button Directive \u09b2\u09c7\u0996\u09be<br \/>\nescribe(\u2018button directive\u2019, function () {<br \/>\nvar $compile, $rootScope;<br \/>\nbeforeEach(module(\u2018directives.button\u2019));<br \/>\nbeforeEach(inject(function(_$compile_, _$rootScope_) {<br \/>\n$compile = _$compile_;<br \/>\n$rootScope = _$rootScope_;<br \/>\n}));<br \/>\nit(\u2018adds a \u201cbtn\u201d class to the button element\u2019, function() {<br \/>\nvar element = $compile(\u2018&lt;button&gt;&lt;\/button&gt;\u2019)($rootScope);<br \/>\nexpect(element.hasClass(\u2018btn\u2019)).toBe(true);<br \/>\n});<br \/>\n});<br \/>\n});<\/p>\n<p>button directive \u09ac\u09cd\u09af\u09ac\u09b9\u09be\u09b0<br \/>\n&lt;button type=\u201dsubmit\u201d<br \/>\n&gt;Click Me!&lt;\/button&gt;<\/p>\n<p>\u098f\u0995\u099f\u09bf Custom Validation Directives \u09aa\u09cd\u09b0\u09ac\u09b0\u09cd\u09a4\u09a8<br \/>\n\u098f\u0995\u099f\u09bf Custom Validation directive \u09aa\u09cd\u09b0\u09ac\u09b0\u09cd\u09a4\u09a8<\/p>\n<p>\u098f\u0987 \u099c\u09be\u09df\u0997\u09be\u09df \u0986\u09ae\u09be\u09a6\u09c7\u09b0 \u098f\u0995\u099f\u09be test \u0986\u099b\u09c7, \u09b8\u09c1\u09a4\u09b0\u09be\u0982 \u0986\u09ae\u09b0\u09be directive \u098f\u09b0 \u0995\u09be\u09b0\u09cd\u09af\u0995\u09be\u09b0\u09bf\u09a4\u09be \u09ac\u09be\u09b8\u09cd\u09a4\u09ac\u09be\u09af\u09bc\u09a8 \u0995\u09b0\u09a4\u09c7 \u09aa\u09be\u09b0\u09bf\u0983<\/p>\n<p>myModule.directive(\u2018validateEquals\u2019, function() {<br \/>\nreturn {<br \/>\nrequire: \u2018ngModel\u2019,<br \/>\nlink: function(scope, elm, attrs, ngModelCtrl) {<br \/>\nfunction validateEqual(myValue) {<br \/>\nvar valid= (myValue === scope.$eval(attrs.validateEquals));<br \/>\nngModelCtrl.$setValidity(\u2018equal\u2019, valid);<br \/>\nreturn valid ? myValue : undefined;<br \/>\n}<br \/>\nngModelCtrl.$parsers.push(validateEqual);<br \/>\nngModelCtrl.$formatters.push(validateEqual);<br \/>\nscope.$watch(attrs.validateEquals, function() {<br \/>\nngModelCtrl.$setViewValue(ngModelCtrl.$viewValue);<br \/>\n});<br \/>\n}<br \/>\n};<br \/>\n});<\/p>\n","protected":false},"excerpt":{"rendered":"<p>AngularJS \u098f\u09b0 \u09ae\u09be\u09a7\u09cd\u09af\u09ae\u09c7 \u09a8\u09bf\u099c\u09c7\u09b0 Directives \u09a4\u09c8\u09b0\u09bf\u0964 Md. Shahinoor Islam\u09a8\u09bf\u099c\u09c7\u09b0 Directives \u09a4\u09c8\u09b0\u09bf\u0964 HTML \u0989\u09aa\u09be\u09a6\u09be\u09a8, \u09ae\u09a8\u09cd\u09a4\u09ac\u09cd\u09af \u09ac\u09be CSS classes \u09a6\u09bf\u09df\u09c7 Directives \u09aa\u09cd\u09b0\u09a6\u09b0\u09cd\u09b6\u09a8 \u0995\u09b0\u09a4\u09c7 \u09aa\u09be\u09b0\u0964 \u0989\u09a6\u09be\u09b9\u09b0\u09a8\u0983 &lt;my-directive&gt;&lt;\/my-directive&gt; &lt;input my-directive&gt; &lt;!\u2013 directive: my-directive\u2013&gt; &lt;input&gt; \u098f\u0995\u099f\u09bf Directive \u098f\u09b0 \u09a7\u09be\u09b0\u09a8\u09be angular.module(\u2018app\u2019, []).directive(\u2018myDir\u2019, function() { return myDirectiveDefinition; }); \u098f\u0995\u099f\u09bf Button Directive \u09b2\u09c7\u0996\u09be escribe(\u2018button directive\u2019, function () { var $compile, $rootScope; beforeEach(module(\u2018directives.button\u2019)); beforeEach(inject(function(_$compile_, &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=7438\">Continue reading<\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[154],"tags":[271,274],"class_list":["post-7438","post","type-post","status-publish","format-standard","hentry","category-angularjs-001","tag-angular-js","tag-directive","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":68351,"url":"http:\/\/bangla.sitestree.com\/?p=68351","url_meta":{"origin":7438,"position":0},"title":"Building Your Own Directives in AngularJS #AngularJS #By Sayed Ahmed","author":"Author-Check- Article-or-Video","date":"August 1, 2021","format":false,"excerpt":"Building Your Own Directives Directives can appear as HTML elements, attributes, comments, or CSS classes. Examples <my-directive><\/my-directive> <input my-directive> <!-- directive: my-directive--> <input> Defining a Directive angular.module('app', []).directive('myDir', function() { return myDirectiveDefinition; }); Writing a Button Directive escribe('button directive', function () { var $compile, $rootScope; beforeEach(module('directives.button')); beforeEach(inject(function(_$compile_, _$rootScope_) { $compile\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5792,"url":"http:\/\/bangla.sitestree.com\/?p=5792","url_meta":{"origin":7438,"position":1},"title":"AngularJS \u09a1\u09bf\u09b0\u09c7\u0995\u09cd\u099f\u09bf\u09ad (AngularJS Directives in Bangla)","author":"Author-Check- Article-or-Video","date":"January 27, 2015","format":false,"excerpt":"\u09aa\u09b0\u09be\u099c\u09bf\u09a4 \u09ac\u09bf\u09b6\u09cd\u09ac\u09be\u09b8 \u00a0 AngularJs \u0986\u09aa\u09a8\u09be\u0995\u09c7 \u09a8\u09a4\u09c1\u09a8 \u098f\u099f\u09cd\u09b0\u09bf\u09ac\u09bf\u0989\u099f Directives \u098f\u09b0 \u09ae\u09be\u09a7\u09cd\u09af\u09ae\u09c7 html \u0995\u09c7 \u09ac\u09cd\u09af\u09be\u0996\u09cd\u09af\u09be \u0995\u09b0\u09a4\u09c7 \u09b8\u09be\u09b9\u09be\u09af\u09cd\u09af \u0995\u09b0\u09ac\u09c7 \u0964 AngularJS \u098f\u09b0 \u098f\u0995 \u09b8\u09c7\u099f \u09ac\u09bf\u09b2\u09cd\u099f \u0987\u09a8 Directives \u0986\u099b\u09c7, \u09af\u09be \u0986\u09aa\u09a8\u09be\u09b0 \u09aa\u09cd\u09b0\u09a4\u09cd\u09af\u09c7\u0995\u099f\u09bf \u0985\u09cd\u09af\u09be\u09aa\u09cd\u09b2\u09bf\u0995\u09c7\u09b6\u09a8\u0995\u09c7 \u0995\u09be\u09b0\u09cd\u09af\u0995\u09b0\u09bf \u0995\u09b0\u09c7 \u09a4\u09cb\u09b2\u09c7\u0964 AngularJs \u0986\u09aa\u09a8\u09be\u0995\u09c7 \u0986\u09aa\u09a8\u09be\u09b0 \u09a8\u09bf\u099c\u09b8\u09cd\u09ac Directive \u09b8\u0982\u0999\u09cd\u0997\u09be\u09df\u09bf\u09a4 \u0995\u09b0\u09be\u09b0 \u09b8\u09c1\u09af\u09cb\u0997 \u09a6\u09c7\u09df\u0964 \u00a0 AngularJS \u09a1\u09bf\u09b0\u09c7\u0995\u09cd\u099f\u09bf\u09ad (AngularJS Directives) AngularJs \u0986\u09aa\u09a8\u09be\u0995\u09c7 ng- prefix\u2026","rel":"","context":"In &quot;AngularJS - 001&quot;","block_context":{"text":"AngularJS - 001","link":"http:\/\/bangla.sitestree.com\/?cat=154"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5775,"url":"http:\/\/bangla.sitestree.com\/?p=5775","url_meta":{"origin":7438,"position":2},"title":"AngularJS \u09aa\u09b0\u09bf\u099a\u09bf\u09a4\u09bf (AngularJS Introduction in Bangla)","author":"Author-Check- Article-or-Video","date":"January 19, 2015","format":false,"excerpt":"\u09aa\u09be\u09b0\u09bf\u099c\u09be\u09a4 \u09ac\u09bf\u09b6\u09cd\u09ac\u09be\u09b8 AngularJS \u098f\u0995\u099f\u09bf JavaScript \u098f\u09b0 framework \u0964 \u098f\u099f\u09bf HTML \u09aa\u09c7\u099c\u09c7\u09b0 \u09b8\u09be\u09a5\u09c7 <script> tag \u098f\u09b0 \u09ae\u09be\u09a7\u09cd\u09af\u09ae\u09c7 \u09af\u09cb\u0997 \u0995\u09b0\u09be \u09b9\u09df\u0964 AngularJS \u098f\u0987\u099a\u099f\u09bf\u098f\u09ae\u098f\u09b2 \u098f\u099f\u09cd\u09b0\u09bf\u09ac\u09bf\u0989\u099f \u098f\u09b0 \u09a8\u09bf\u09b0\u09cd\u09a6\u09c7\u09b6\u09a8\u09be (Directive) \u0985\u09a8\u09c1\u09b8\u09be\u09b0\u09c7 \u09aa\u09cd\u09b0\u09b8\u09be\u09b0\u09bf\u09a4 \u0995\u09b0\u09c7 \u098f\u09ac\u0982 HTML \u098f\u09b0 Expression \u098f\u09b0 \u09b8\u09be\u09a5\u09c7 \u09a4\u09a5\u09cd\u09af \u09ae\u09bf\u09b6\u09cd\u09b0\u09bf\u09a4 \u0995\u09b0\u09c7 \u0964 \u00a0 AngularJS \u098f\u0995\u099f\u09bf JavaScript Framework AngularJS \u098f\u0995\u099f\u09bf JavaScript Framework \u0964 \u098f\u099f\u09be JavaScript\u2026","rel":"","context":"In &quot;AngularJS - 001&quot;","block_context":{"text":"AngularJS - 001","link":"http:\/\/bangla.sitestree.com\/?cat=154"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5794,"url":"http:\/\/bangla.sitestree.com\/?p=5794","url_meta":{"origin":7438,"position":3},"title":"AngularJS HTML DOM","author":"Author-Check- Article-or-Video","date":"January 28, 2015","format":false,"excerpt":"AngularJS HTML DOM parijat biswas student of CSE university of Asia Pacific AngularJs Directives \u0997\u09c1\u09b2\u09cb HTML DOM \u0989\u09aa\u09be\u09a6\u09be\u09a8\u0997\u09c1\u09b2\u0995\u09c7 \u0985\u09cd\u09af\u09be\u09aa\u09cd\u09b2\u09bf\u0995\u09c7\u09b6\u09a8 \u09a1\u09be\u099f\u09be\u09a4\u09c7 \u09af\u09c1\u0995\u09cd\u09a4 \u0995\u09b0\u09c7 \u0964 ng-disabled Directive ng-disabled directive Angularjs \u0985\u09cd\u09af\u09be\u09aa\u09cd\u09b2\u09bf\u0995\u09c7\u09b6\u09a8 \u09a1\u09be\u099f\u09be\u0995\u09c7 disabled html \u0989\u09aa\u09be\u09a6\u09be\u09a8\u0997\u09c1\u09b2\u09cb\u09b0 \u09b8\u09be\u09a5\u09c7 \u09af\u09c1\u0995\u09cd\u09a4 \u0995\u09b0\u09c7 \u0964 AngularJS \u0989\u09a6\u09be\u09b9\u09b0\u09a8\u0983 <div ng-app=\"\"> <p> mySwitch\">Click Me! <\/p> <p> <input type=\"checkbox\" ng-model=\"mySwitch\">Button <\/p>\u2026","rel":"","context":"In &quot;AngularJS - 001&quot;","block_context":{"text":"AngularJS - 001","link":"http:\/\/bangla.sitestree.com\/?cat=154"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5804,"url":"http:\/\/bangla.sitestree.com\/?p=5804","url_meta":{"origin":7438,"position":4},"title":"AngularJS References","author":"Author-Check- Article-or-Video","date":"February 2, 2015","format":false,"excerpt":"AngularJS References parijat biswas student of CSE university of Asia Pacific AngularJS Directives \u09af\u09c7\u09b8\u09ac AngularJS Directives \u098f\u0987 \u099f\u09bf\u0989\u099f\u09cb\u09b0\u09bf\u09df\u09be\u09b2\u09c7 \u09ac\u09cd\u09af\u09ac\u09b9\u09c3\u09a4 \u09b9\u09df\u099b\u09c7\u0983 Directive \u09ac\u09b0\u09cd\u09a3\u09a8\u09be \u09ac\u09cd\u09af\u09be\u0996\u09cd\u09af\u09be ng-app \u098f\u0995\u099f\u09bf \u0985\u09cd\u09af\u09be\u09aa\u09cd\u09b2\u09bf\u0995\u09c7\u09b6\u09a8 \u098f\u09b0 \u09ae\u09c2\u09b2 \u0989\u09aa\u09be\u09a6\u09be\u09a8 \u09b8\u0982\u099c\u09cd\u099e\u09be\u09af\u09bc\u09bf\u09a4 \u0995\u09b0\u09be\u09b0 \u099c\u09a8\u09cd\u09af \u09ac\u09cd\u09af\u09ac\u09b9\u09c3\u09a4 Directives ng-bind HTML element \u098f\u09b0 innerHTML \u098f\u09aa\u09cd\u09b2\u09bf\u0995\u09c7\u09b6\u09a8 \u09a1\u09be\u099f\u09be\u09a4\u09c7 \u09af\u09c1\u0995\u09cd\u09a4 \u0995\u09b0\u09c7 \u0964 Introduction ng-click \u098f\u0995\u099f\u09bf \u0989\u09aa\u09be\u09a6\u09be\u09a8 \u0995\u09cd\u09b2\u09bf\u0995 \u0995\u09b0\u09be\u2026","rel":"","context":"In &quot;AngularJS - 001&quot;","block_context":{"text":"AngularJS - 001","link":"http:\/\/bangla.sitestree.com\/?cat=154"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5788,"url":"http:\/\/bangla.sitestree.com\/?p=5788","url_meta":{"origin":7438,"position":5},"title":"\u0985\u09cd\u09af\u09be\u0999\u09cd\u0997\u09c1\u09b2\u09be\u09b0 \u099c\u09c7\u098f\u09b8 (AngularJS) \u09ab\u09b0\u09ae (Forms)","author":"Author-Check- Article-or-Video","date":"January 25, 2015","format":false,"excerpt":"\u0985\u09cd\u09af\u09be\u0999\u09cd\u0997\u09c1\u09b2\u09be\u09b0 \u099c\u09c7\u098f\u09b8 (AngularJS) \u09ab\u09b0\u09ae (Forms) Article By : Protap Chandra -------- \u0986\u099c\u0995\u09c7\u09b0 \u099f\u09bf\u0989\u099f\u09b0\u09bf\u09df\u09be\u09b2\u09c7 \u0986\u09ae\u09b0\u09be AngularJS \u09ab\u09b0\u09ae \u09b8\u09ae\u09cd\u09aa\u09b0\u09cd\u0995\u09c7 \u099c\u09be\u09a8\u09ac\u0964 AngularJS \u09ab\u09b0\u09ae \u09b9\u099a\u09cd\u099b\u09c7 HTML \u0987\u09a8\u09aa\u09c1\u099f element \u09b8\u09ae\u09c2\u09b9\u09c7\u09b0 \u09b8\u09c7\u099f, \u09af\u09be HTML controls \u09a8\u09be\u09ae\u09c7 \u09aa\u09b0\u09bf\u099a\u09bf\u09a4\u0964 \u09af\u09c7\u09ae\u09a8 - \u2022 input elements \u2022 select elements \u2022 button elements \u2022 textarea elements AngularJS \u09ab\u09b0\u09ae \u09ac\u09cd\u09af\u09ac\u09b9\u09be\u09b0\u09c7\u09b0 \u0989\u09a6\u09be\u09b9\u09b0\u09a3: formController\">\u2026","rel":"","context":"In &quot;AngularJS - 001&quot;","block_context":{"text":"AngularJS - 001","link":"http:\/\/bangla.sitestree.com\/?cat=154"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/7438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7438"}],"version-history":[{"count":3,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/7438\/revisions"}],"predecessor-version":[{"id":10823,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/7438\/revisions\/10823"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7438"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}