• Randall Leeds's avatar
    Eliminate the explicit account module · 11e809f7
    Randall Leeds authored
    Angular is smart enough to not instantiate the application until all
    pending scripts have been loaded. That means that we can load optional
    components by simply appending the script tags. We already load the
    account component after the app component. By having the account
    component attach its controllers and configuration functions to the
    existing 'h' module, rather than defining a new angular module, the
    app can avoid having a dependency on 'h.account'. This removes the
    requirement that integrators define this module. Instead, they can
    just attach a configuration function to the main module if they need
    to configure the identity provider.
    
    I have a mild preference for this pattern, since strictly speaking no
    account module needs to be present. With a little morke tweaking, the
    interface could be made to not have a sign in link and operate in an
    anonymous mode by default, assuming that the server requires no
    authorization to annotate.
    11e809f7
account-controller-test.coffee 6.24 KB