Skip to content
This repository was archived by the owner on Jul 29, 2026. It is now read-only.
This repository was archived by the owner on Jul 29, 2026. It is now read-only.

Navbar as Directive #457

Closed
Closed

Description

@kingcody

Just wondering if anyone else has considered this?

I normally implement it as a directive and it seems to be fairly beneficial. Allows for easier includes and more control over its setup.

Activity

  1. remicastaing commented on Aug 17, 2014

    @remicastaing
    Contributor

    In the same vain, having "sign in" and "sign up" directives could be useful to easily move this forms in another place (for instance, on the landing page).

  2. kingcody commented on Aug 17, 2014

    @kingcody
    MemberAuthor

    Or in a modal :)

  3. kingcody commented on Aug 17, 2014

    @kingcody
    MemberAuthor

    For anyone interested, I have a generated project in a test repo that contains an opinionated 'angular-fullstack navbar'.

    Opinions:

    • move as much manipulation logic out of the controller as possible
    • store navbar data in a service so it can be accessed by other controllers, services, etc...
    • use the controllerAs syntax
    • bind Auth to the $scope, not the Controller(this)

    Also, I took a first attempt at writing test. I included a spec for the controller, service, and directive. Being those are my first 'test' with karma or jasmine, I wouldn't mind if someone pointed out any mistakes or shortcomings.

  4. remicastaing commented on Aug 17, 2014

    @remicastaing
    Contributor

    How can I get rid of all this request:

    ...
    GET /socket.io/?EIO=2&transport=polling&t=1408307307222-6517 200 6ms
    ...
    

    It's polluting the console.

  5. remicastaing commented on Aug 17, 2014

    @remicastaing
    Contributor

    Weird. They are gone.

  6. kingcody commented on Aug 17, 2014

    @kingcody
    MemberAuthor

    It's from restarting the server and not doing a fresh reload on the client side.

    A 'force reload' in the browser always fixes it for me.

  7. kingcody commented on Aug 17, 2014

    @kingcody
    MemberAuthor

    More specifically, it's because the socket.io endpoint has been changed and you client was 'polling' the old endpoint. Which would now simply default to serving the main index.html; hence all the the short 200 responses.

  8. added this to the milestone on Jul 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions