CopyPastor

Detecting plagiarism made easy.

Score: 1.8385480046272278; Reported for: String similarity, Exact paragraph match Open both answers

Possible Plagiarism

Plagiarized on 2018-05-15
by PPL

Original Post

Original - Posted on 2014-10-16
by SDK



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Try below code
app.directive("directive_name", function(){ return { restrict:'E', transclude:true, template:'<div class="title"><h2>{{title}}</h3></div>', scope:{ accept:"=" }, replace:true }; })
it sets up a two-way binding between the value of the 'accept' attribute and the parent scope.
And also you can set two way data binding with property: '='
For example, if you want both key and value bound to the local scope you would do:

scope:{ key:'=', value:'=' },
For more info, https://docs.angularjs.org/guide/directive
So, if you want to pass an argument from controller to directive, then refer this below fiddle
http://jsfiddle.net/jaimem/y85Ft/7/
Hope it helps..
You can try like below: app.directive("directive_name", function(){ return { restrict:'E', transclude:true, template:'<div class="title"><h2>{{title}}</h3></div>', scope:{ accept:"=" }, replace:true }; })
it sets up a two-way binding between the value of the 'accept' attribute and the parent scope.
And also you can set two way data binding with property: '='
For example, if you want both key and value bound to the local scope you would do:
scope:{ key:'=', value:'=' }, For more info, https://docs.angularjs.org/guide/directive
So, if you want to pass an argument from controller to directive, then refer this below fiddle
http://jsfiddle.net/jaimem/y85Ft/7/
Hope it helps..

        
Present in both answers; Present only in the new answer; Present only in the old answer;