Getting reference from directive scope variable

时间:2015-05-12 22:41:27

标签: javascript angularjs

git checkout mainline
git log development   # assume acf123 is the last commit you want
git merge acf123      # fast forward to the right commit

I'm using a third party library which doesn't give me access to a particular directive scoped variable. Is there a way that my controller could grab the reference or set a value?

1 个答案:

答案 0 :(得分:0)

You can use select.squarecorners{ border: 0; outline: 1px solid #CCC; background-color: white; } to bind it to a variable defined in the outer-scope. E.g.:

Controller:

ng-init

Template:

function myController($scope) {
    //Due to inheritance rules between scopes we must place the scope variable
    //in a container and not directly on the scope, otherwise it won't work
    $scope.scopes = {};
}