Edit in JSRun

var myapp = angular.module('myapp',[]);

myapp.controller('ctrl_a',function($scope){
	$scope.test_name = 'lyl'
})

myapp.directive('goodTime',function(){
	return {
		restrict:'EAM',
		template:"<div><input type='text' ng-model='text_name'>{{test_name}}</div>",
		replace:true,
		transclude:false,
		scope:{
			aaa:'@myAbb',
			myAbb:'=myA',
			test_name:'='
		},
		link:function($scope,ele,attr){
			console.log($scope);
			console.warn(attr);
		}
	}
})
<div ng-app='myapp'>
	<div ng-controller='ctrl_a'>
	   {{123}}
		<div ng-init='abc=true' good-time data-a=123 data-b=34234 my-a=123123  my-abb=111>1111</div>
    
    <a ng-click="abc=!abc">点击切换input</a>
    <input type='text' placeholder='aaaa' ng-if="abc">
    <input type='text' placeholder='bbbb' ng-if="!abc">

	</div>
</div>

            

本项目引用的自定义外部资源