AngularJS - Scope value not accessible in the directive Scope

前端 未结 6 1516
梦谈多话
梦谈多话 2021-01-26 09:01

FIDDLE

I have created a directive :-

return {
        restrict: \'EAC\',
        scope: {
            statesActive: \'=\'
        },            
                 


        
6条回答
  •  心在旅途
    2021-01-26 09:51

    return {
            restrict: 'EAC',
            scope: {
                statesActive: '='
            },            
            link: function (scope, element, attrs) {
            var stateData = angular.fromJson(attrs.statesActive).states; // Probably, your "states" model here
            ....
    }
    

提交回复
热议问题