Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

controllerAs syntax support #9

Closed
char0n opened this issue Feb 3, 2016 · 2 comments
Closed

controllerAs syntax support #9

char0n opened this issue Feb 3, 2016 · 2 comments

Comments

@char0n
Copy link

char0n commented Feb 3, 2016

Hi,

There seems to be no support for controllerAs syntax. It there any planned support for controllerAs syntax ?

I have been experimenting with your directive and these 2 functions, but with any solid result yet.

function getPropertyByPath(obj, path) {
  var i, j, parent, ref;
  path = path.split('.');
  parent = obj;
  if (path.length > 1) {
    for (i = j = 0, ref = path.length - 2; 0 <= ref ? j <= ref : j >= ref; i = 0 <= ref ? ++j : --j) {
      parent = parent[path[i]];
    }
  }
  return parent != null ? parent[path[path.length - 1]] : void 0;
}

function setPropertyByPath(obj, path, value) {
  var i, j, name, parent, ref;
  path = path.split('.');
  parent = obj;
  if (path.length > 1) {
    for (i = j = 0, ref = path.length - 2; 0 <= ref ? j <= ref : j >= ref; i = 0 <= ref ? ++j : --j) {
      parent = (parent[name = path[i]] || (parent[name] = {}));
    }
  }
  return parent[path[path.length - 1]] = value;
}
@char0n
Copy link
Author

char0n commented Feb 3, 2016

Your documentation also says that this is possible:

<li immutable="data.nestedList" ng-repeat="item in immutables track by $index" ng-bind="item"></li>

But from the source code I can clearly see that it is not.

if (!/^[a-zA-Z0-9_$]+$/.test(immutable)) {

Am I missing something here ?

@mgechev
Copy link
Owner

mgechev commented Feb 3, 2016

@char0n the documentation is out-of-date. I'll update not now.

At this point I don't have plans to implement controllerAs syntax since I'm mostly focused on Angular 2.

@mgechev mgechev closed this as completed Feb 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants