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

refactor(NgView): Make use of the ViewPort #910

Merged
merged 2 commits into from
Apr 23, 2014

Conversation

vicb
Copy link
Contributor

@vicb vicb commented Apr 16, 2014

This should be solving #704 however I can not get the test to work, any hint would be appreciated here (it seems to work fine in my test app).

Todo:

There are a few style changes in the first commit, if this is still too much, let me know but it should be pretty localized and trivial

@vicb vicb added cla: yes and removed cla: no labels Apr 16, 2014
@mhevery
Copy link
Contributor

mhevery commented Apr 22, 2014

Tests pass for me. Do you still need help, or is this PR ready to go?

@vicb
Copy link
Contributor Author

vicb commented Apr 22, 2014

Oops hadn't seen your message about test passing. I'll try.

@vicb
Copy link
Contributor Author

vicb commented Apr 22, 2014

Tests still do not pass for me with the same message

    Test failed: Caught Expected: 'Foo'
      Actual: ''
       Which: is different. Both strings start the same, but the given value is missing the following trailing characters: Foo

Any help appreciated.

@mhevery
Copy link
Contributor

mhevery commented Apr 23, 2014

Try:

    iit('should switch template when route is already active', async(() {
      // Force the routing system to initialize.
      _.compile('<div><ng-view></ng-view></div>');

      router.route('/foo');
      microLeap();
      Element root = _.compile('<div><ng-view></ng-view></div>');
      expect(root.text).toEqual('');

      _.rootScope.apply();
      microLeap();
      _.rootScope.apply();
      print(_.rootElement.outerHtml);
      expect(root.text).toEqual('Foo');
    }));

You need the wrapping div. This is because can not replace itself with comment node if it is top level item. It needs a container.

@vicb
Copy link
Contributor Author

vicb commented Apr 23, 2014

@mhevery thanks for the explanation. The PR is on the presubmit queue.

@vicb vicb changed the title [WIP] refactor(NgView): Make use of the ViewPort refactor(NgView): Make use of the ViewPort Apr 23, 2014
@mhevery mhevery merged commit ed40de4 into dart-archive:master Apr 23, 2014
@@ -7,24 +7,20 @@ part of angular.directive;
*/
@Decorator(
selector: 'form',
module: NgForm.module,
visibility: Directive.CHILDREN_VISIBILITY)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these changes have nothing to do with NgView

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've only removed this (because this is the default value) everywhere for consistency

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

Routing should use ViewPort
4 participants