Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Removing implicit map dereference in expressions #915

Open
mhevery opened this issue Apr 16, 2014 · 0 comments
Open

Removing implicit map dereference in expressions #915

mhevery opened this issue Apr 16, 2014 · 0 comments

Comments

@mhevery
Copy link
Contributor

mhevery commented Apr 16, 2014

Currently an expression a.b matches both a.b as well as a['b']. The issue is that if a is a Map it is not possible to access map properties such as a.keys.

The reason we do this is because context is Map and it would be awkward to write this['cntl'].foo. cntl.foo is a lot more natural. But once we get rid of Map as context and replace it with actual controller instance this will not be an issue.

Can fix after: #914

@mhevery mhevery added this to the Controller is Context milestone Apr 16, 2014
@vicb vicb self-assigned this May 13, 2014
vicb added a commit to vicb/angular.dart that referenced this issue May 16, 2014
Closes dart-archive#915

Before this PR a.b would have match either a.b or a['b']. The reason is
that the context was a Map (before dart-archive#914) and we don't want to write
ctrl['foo'] but ctrl.foo. It was also not possible to access Map
properties, ie map.length would have returned map['length'].

Now "a.b" return a.b and "a['b']" return a['b']
vicb added a commit to vicb/angular.dart that referenced this issue May 19, 2014
Closes dart-archive#915

Before this PR a.b would have match either a.b or a['b']. The reason is
that the context was a Map (before dart-archive#914) and we don't want to write
ctrl['foo'] but ctrl.foo. It was also not possible to access Map
properties, ie map.length would have returned map['length'].

Now "a.b" return a.b and "a['b']" return a['b']
vicb added a commit to vicb/angular.dart that referenced this issue May 19, 2014
Closes dart-archive#915

Before this PR a.b would have match either a.b or a['b']. The reason is
that the context was a Map (before dart-archive#914) and we don't want to write
ctrl['foo'] but ctrl.foo. It was also not possible to access Map
properties, ie map.length would have returned map['length'].

Now "a.b" return a.b and "a['b']" return a['b']
vicb added a commit to vicb/angular.dart that referenced this issue May 20, 2014
Closes dart-archive#915

Before this PR a.b would have match either a.b or a['b']. The reason is
that the context was a Map (before dart-archive#914) and we don't want to write
ctrl['foo'] but ctrl.foo. It was also not possible to access Map
properties, ie map.length would have returned map['length'].

Now "a.b" return a.b and "a['b']" return a['b']
vicb added a commit to vicb/angular.dart that referenced this issue May 28, 2014
Closes dart-archive#915

Before this PR a.b would have match either a.b or a['b']. The reason is
that the context was a Map (before dart-archive#914) and we don't want to write
ctrl['foo'] but ctrl.foo. It was also not possible to access Map
properties, ie map.length would have returned map['length'].

Now "a.b" return a.b and "a['b']" return a['b']
vicb added a commit to vicb/angular.dart that referenced this issue May 28, 2014
Closes dart-archive#915

1) Now "a.b" return a.b and "a['b']" return a['b']

Before this change a.b would have match either a.b or a['b']. The reason
is that the context was a Map (before dart-archive#914) and we don't want to write
ctrl['foo'] but ctrl.foo. It was also not possible to access Map
properties, ie map.length would have returned map['length'].

2) Accessing probes

The probes are no more accessible directly in the rootScope context but
in a $probes map on the rootScope context.

Before:

    <p probe="prb"></p>

    var probe = rootScope.context['prb'];

After:

    <p probe="prb"></p>

    var probe = rootScope.context.$probes['prb'];
vicb added a commit to vicb/angular.dart that referenced this issue May 28, 2014
Closes dart-archive#915

1) Now "a.b" return a.b and "a['b']" return a['b']

Before this change a.b would have match either a.b or a['b']. The reason
is that the context was a Map (before dart-archive#914) and we don't want to write
ctrl['foo'] but ctrl.foo. It was also not possible to access Map
properties, ie map.length would have returned map['length'].

2) Accessing probes

The probes are no more accessible directly in the rootScope context but
in a $probes map on the rootScope context.

Before:

    <p probe="prb"></p>

    var probe = rootScope.context['prb'];

After:

    <p probe="prb"></p>

    var probe = rootScope.context.$probes['prb'];
vicb added a commit to vicb/angular.dart that referenced this issue Jul 14, 2014
Closes dart-archive#915

1) Now "a.b" return a.b and "a['b']" return a['b']

Before this change a.b would have match either a.b or a['b']. The reason
is that the context was a Map (before dart-archive#914) and we don't want to write
ctrl['foo'] but ctrl.foo. It was also not possible to access Map
properties, ie map.length would have returned map['length'].

2) Accessing probes

The probes are no more accessible directly in the rootScope context but
in a $probes map on the rootScope context.

Before:

    <p probe="prb"></p>

    var probe = rootScope.context['prb'];

After:

    <p probe="prb"></p>

    var probe = rootScope.context.$probes['prb'];
vicb added a commit to vicb/angular.dart that referenced this issue Jul 14, 2014
Closes dart-archive#915

1) Now "a.b" return a.b and "a['b']" return a['b']

Before this change a.b would have match either a.b or a['b']. The reason
is that the context was a Map (before dart-archive#914) and we don't want to write
ctrl['foo'] but ctrl.foo. It was also not possible to access Map
properties, ie map.length would have returned map['length'].

2) Accessing probes

The probes are no more accessible directly in the rootScope context but
in a $probes map on the rootScope context.

Before:

    <p probe="prb"></p>

    var probe = rootScope.context['prb'];

After:

    <p probe="prb"></p>

    var probe = rootScope.context.$probes['prb'];
vicb added a commit to vicb/angular.dart that referenced this issue Jul 15, 2014
Closes dart-archive#915

1) Now "a.b" return a.b and "a['b']" return a['b']

Before this change a.b would have match either a.b or a['b']. The reason
is that the context was a Map (before dart-archive#914) and we don't want to write
ctrl['foo'] but ctrl.foo. It was also not possible to access Map
properties, ie map.length would have returned map['length'].

2) Accessing probes

The probes are no more accessible directly in the rootScope context but
in a $probes map on the rootScope context.

Before:

    <p probe="prb"></p>

    var probe = rootScope.context['prb'];

After:

    <p probe="prb"></p>

    var probe = rootScope.context.$probes['prb'];
vicb added a commit to vicb/angular.dart that referenced this issue Jul 15, 2014
Closes dart-archive#915

1) Now "a.b" return a.b and "a['b']" return a['b']

Before this change a.b would have match either a.b or a['b']. The reason
is that the context was a Map (before dart-archive#914) and we don't want to write
ctrl['foo'] but ctrl.foo. It was also not possible to access Map
properties, ie map.length would have returned map['length'].

2) Accessing probes

The probes are no more accessible directly in the rootScope context but
in a $probes map on the rootScope context.

Before:

    <p probe="prb"></p>

    var probe = rootScope.context['prb'];

After:

    <p probe="prb"></p>

    var probe = rootScope.context.$probes['prb'];
vicb added a commit to vicb/angular.dart that referenced this issue Jul 16, 2014
Closes dart-archive#915

1) Now "a.b" return a.b and "a['b']" return a['b']

Before this change a.b would have match either a.b or a['b']. The reason
is that the context was a Map (before dart-archive#914) and we don't want to write
ctrl['foo'] but ctrl.foo. It was also not possible to access Map
properties, ie map.length would have returned map['length'].

2) Accessing probes

The probes are no more accessible directly in the rootScope context but
in a $probes map on the rootScope context.

Before:

    <p probe="prb"></p>

    var probe = rootScope.context['prb'];

After:

    <p probe="prb"></p>

    var probe = rootScope.context.$probes['prb'];
vicb added a commit to vicb/angular.dart that referenced this issue Jul 16, 2014
Closes dart-archive#915

1) Now "a.b" return a.b and "a['b']" return a['b']

Before this change a.b would have match either a.b or a['b']. The reason
is that the context was a Map (before dart-archive#914) and we don't want to write
ctrl['foo'] but ctrl.foo. It was also not possible to access Map
properties, ie map.length would have returned map['length'].

2) Accessing probes

The probes are no more accessible directly in the rootScope context but
in a $probes map on the rootScope context.

Before:

    <p probe="prb"></p>

    var probe = rootScope.context['prb'];

After:

    <p probe="prb"></p>

    var probe = rootScope.context.$probes['prb'];
vicb added a commit to vicb/angular.dart that referenced this issue Jul 16, 2014
Closes dart-archive#915

1) Now "a.b" return a.b and "a['b']" return a['b']

Before this change a.b would have match either a.b or a['b']. The reason
is that the context was a Map (before dart-archive#914) and we don't want to write
ctrl['foo'] but ctrl.foo. It was also not possible to access Map
properties, ie map.length would have returned map['length'].

2) Accessing probes

The probes are no more accessible directly in the rootScope context but
in a $probes map on the rootScope context.

Before:

    <p probe="prb"></p>

    var probe = rootScope.context['prb'];

After:

    <p probe="prb"></p>

    var probe = rootScope.context.$probes['prb'];

Conflicts:
	lib/change_detection/context_locals.dart
vicb added a commit to vicb/angular.dart that referenced this issue Jul 16, 2014
Closes dart-archive#915

1) Now "a.b" return a.b and "a['b']" return a['b']

Before this change a.b would have match either a.b or a['b']. The reason
is that the context was a Map (before dart-archive#914) and we don't want to write
ctrl['foo'] but ctrl.foo. It was also not possible to access Map
properties, ie map.length would have returned map['length'].

2) Accessing probes

The probes are no more accessible directly in the rootScope context but
in a $probes map on the rootScope context.

Before:

    <p probe="prb"></p>

    var probe = rootScope.context['prb'];

After:

    <p probe="prb"></p>

    var probe = rootScope.context.$probes['prb'];

Conflicts:
	lib/change_detection/context_locals.dart
vicb added a commit to vicb/angular.dart that referenced this issue Jul 17, 2014
Closes dart-archive#915

1) Now "a.b" return a.b and "a['b']" return a['b']

Before this change a.b would have match either a.b or a['b']. The reason
is that the context was a Map (before dart-archive#914) and we don't want to write
ctrl['foo'] but ctrl.foo. It was also not possible to access Map
properties, ie map.length would have returned map['length'].

2) Accessing probes

The probes are no more accessible directly in the rootScope context but
in a $probes map on the rootScope context.

Before:

    <p probe="prb"></p>

    var probe = rootScope.context['prb'];

After:

    <p probe="prb"></p>

    var probe = rootScope.context.$probes['prb'];

Conflicts:
	lib/change_detection/context_locals.dart
vicb added a commit to vicb/angular.dart that referenced this issue Jul 25, 2014
Closes dart-archive#915

1) Now "a.b" return a.b and "a['b']" return a['b']

Before this change a.b would have match either a.b or a['b']. The reason
is that the context was a Map (before dart-archive#914) and we don't want to write
ctrl['foo'] but ctrl.foo. It was also not possible to access Map
properties, ie map.length would have returned map['length'].

2) Accessing probes

The probes are no more accessible directly in the rootScope context but
in a $probes map on the rootScope context.

Before:

    <p probe="prb"></p>

    var probe = rootScope.context['prb'];

After:

    <p probe="prb"></p>

    var probe = rootScope.context.$probes['prb'];
vicb added a commit to vicb/angular.dart that referenced this issue Jul 28, 2014
Closes dart-archive#915

1) Now "a.b" return a.b and "a['b']" return a['b']

Before this change a.b would have match either a.b or a['b']. The reason
is that the context was a Map (before dart-archive#914) and we don't want to write
ctrl['foo'] but ctrl.foo. It was also not possible to access Map
properties, ie map.length would have returned map['length'].

2) Accessing probes

The probes are no more accessible directly in the rootScope context but
in a $probes map on the rootScope context.

Before:

    <p probe="prb"></p>

    var probe = rootScope.context['prb'];

After:

    <p probe="prb"></p>

    var probe = rootScope.context.$probes['prb'];
vicb added a commit to vicb/angular.dart that referenced this issue Jul 28, 2014
Closes dart-archive#915

1) Now "a.b" return a.b and "a['b']" return a['b']

Before this change a.b would have match either a.b or a['b']. The reason
is that the context was a Map (before dart-archive#914) and we don't want to write
ctrl['foo'] but ctrl.foo. It was also not possible to access Map
properties, ie map.length would have returned map['length'].

2) Accessing probes

The probes are no more accessible directly in the rootScope context but
in a $probes map on the rootScope context.

Before:

    <p probe="prb"></p>

    var probe = rootScope.context['prb'];

After:

    <p probe="prb"></p>

    var probe = rootScope.context.$probes['prb'];
vicb added a commit to vicb/angular.dart that referenced this issue Jul 30, 2014
Closes dart-archive#915

1) Now "a.b" return a.b and "a['b']" return a['b']

Before this change a.b would have match either a.b or a['b']. The reason
is that the context was a Map (before dart-archive#914) and we don't want to write
ctrl['foo'] but ctrl.foo. It was also not possible to access Map
properties, ie map.length would have returned map['length'].

2) Accessing probes

The probes are no more accessible directly in the rootScope context but
in a $probes map on the rootScope context.

Before:

    <p probe="prb"></p>

    var probe = rootScope.context['prb'];

After:

    <p probe="prb"></p>

    var probe = rootScope.context.$probes['prb'];
vicb added a commit to vicb/angular.dart that referenced this issue Jul 31, 2014
Closes dart-archive#915

1) Now "a.b" return a.b and "a['b']" return a['b']

Before this change a.b would have match either a.b or a['b']. The reason
is that the context was a Map (before dart-archive#914) and we don't want to write
ctrl['foo'] but ctrl.foo. It was also not possible to access Map
properties, ie map.length would have returned map['length'].

2) Accessing probes

The probes are no more accessible directly in the rootScope context but
in a $probes map on the rootScope context.

Before:

    <p probe="prb"></p>

    var probe = rootScope.context['prb'];

After:

    <p probe="prb"></p>

    var probe = rootScope.context.$probes['prb'];
rkirov pushed a commit to rkirov/angular.dart that referenced this issue Jul 31, 2014
Closes dart-archive#915

1) Now "a.b" return a.b and "a['b']" return a['b']

Before this change a.b would have match either a.b or a['b']. The reason
is that the context was a Map (before dart-archive#914) and we don't want to write
ctrl['foo'] but ctrl.foo. It was also not possible to access Map
properties, ie map.length would have returned map['length'].

2) Accessing probes

The probes are no more accessible directly in the rootScope context but
in a $probes map on the rootScope context.

Before:

    <p probe="prb"></p>

    var probe = rootScope.context['prb'];

After:

    <p probe="prb"></p>

    var probe = rootScope.context.$probes['prb'];
vicb added a commit to vicb/angular.dart that referenced this issue Aug 1, 2014
Closes dart-archive#915

1) Now "a.b" return a.b and "a['b']" return a['b']

Before this change a.b would have match either a.b or a['b']. The reason
is that the context was a Map (before dart-archive#914) and we don't want to write
ctrl['foo'] but ctrl.foo. It was also not possible to access Map
properties, ie map.length would have returned map['length'].

2) Accessing probes

The probes are no more accessible directly in the rootScope context but
in a $probes map on the rootScope context.

Before:

    <p probe="prb"></p>

    var probe = rootScope.context['prb'];

After:

    <p probe="prb"></p>

    var probe = rootScope.context.$probes['prb'];

3) Forms

As a side effect of this change, the forms are now available in the
context field named after the form:

    @component(
        selector: 'my-component',
        template: '''
          <form name="myForm">
            <input type="text" ng-model="model">
          </form>
        '''
    )
    class Component {
      // myForm is automatically initialized to the NgForm instance
      NgForm myForm;
    }

When the field named after the form is not present, an exception is
thrown.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants