No warning or error on mistake in the attribute "publishAs" of NgComponent definition #413

Open
mikhaylov-ilya opened this Issue Jan 12, 2014 · 5 comments

Projects

None yet

5 participants

@mikhaylov-ilya

Here is a sample code:
my_element.dart

@NgComponent(
  selector: 'my-element',
  templateUrl: 'packages/test/components/my_component/my_element.html',
  publishAs: 'Crtl',
  map: const {
    'comment' : '@comment',
  }
)

and my_element.html

<span>{{Ctrl.comment}}</span>

in that case the Dart Editor runs my app OK, but data binding don't works and there are not any warnings or even errors about using wrong component identifier in template.
I spent a lot of time last night trying to find a what wrong with data bindings with my custom controller :(

@pavelgj
Angular member

@mhevery I was wondering if publishAs should default to ctrl -- everyone seems to use it anyway.

@zoechi

+1

@mhevery mhevery was assigned Jan 22, 2014
@mhevery
Angular member

Good question. Possibly, but not everything needs to be published.

@mhevery mhevery modified the milestone: ProtractorDart, v0.9.7, Scope v2.0 Feb 5, 2014
@mhevery
Angular member

OK, the publishAs will go away with the new Scope, since the controller controller will be the scope.

Moving Scope v2.0 milestone

@mhevery mhevery assigned vicb and unassigned mhevery Apr 9, 2014
@mhevery
Angular member

@vicb This issue should be closed once we deprecate publishAs in favor of always using the controller as resolution context.

@mhevery mhevery modified the milestone: Controller is Context, v1.0 Apr 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment