Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9218483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:52:29+00:00 2026-06-18T02:52:29+00:00

I have a fairly simple, 2-page web app. using Angular and Lawnchair. I have

  • 0

I have a fairly simple, 2-page web app. using Angular and Lawnchair. I have a login page from which I do not want to allow the screen/view to change until the user has been authenticated and relevant data has been pulled. Additionally, this is a mobile app. so the user may just need to be re-authenticated and their data loaded from their browser.

<!DOCTYPE html>
<html xmlns:ng="http://angularjs.org" ng:app="AppMod">
<head>
...
</head>
<body ng:controller="AppCtrl">
    <ng:view></ng:view>
    ...
</body>
</html>

When I use Lawnchair without an adapter, Angular changes views just fine and Lawnchair saves the data in the browser but not to something permanent like WebSQL or IndexedDB. However, as soon as one or more Lawnchair adapters are included, at worst the view will not display or at best it will update the location/URI without changing the view (until another event like ‘change’ is emitted).

$scope['login'] = function()
{
    AuthSvc.query(
        {'username':$scope['username'], 'password':$scope['password']},
        function( results )
        {
            LastUsedRsc.save({'key':'credentials', 'value':
                {'username':$scope['username'], 'password':$scope['password']}});
            $location.path( '/dataset' );
        },
        function( error )
        {
            alert( "Incorrect username and/or password." );
        });
    return( false );
};

I have tried $scope.$apply(), $scope.$digest(), their respective “safe” wrappers, etc. Here is a JSFiddle for your review. If you remove the Lawnchair adapters under Manage Resources and Run the fiddle again, you will see the views will start working, but Lawnchair is now worthless because nothing is truly persisted. What do I need to make views change while using one of Lawnchair’s adapters?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T02:52:30+00:00Added an answer on June 18, 2026 at 2:52 am

    You really need to run $digest or $apply after resolving the promises on LoginResolver and DatasetResolver.

    Example:

    var LoginResolver = {
        'credentialsAsync':function( $rootScope, $q, $route, LastUsedRsc ) {
            var deferred = $q.defer();
            LastUsedRsc.get( 'credentials', function( object ) {
                deferred.resolve( object );
                $rootScope.$digest();
            },
            function( error ) {
                window.console.info( "Using default, default value.", error );            
                deferred.resolve({'value':{}});      
                $rootScope.$digest();
            });
        return( deferred.promise );
        },
    };
    

    Note: You need to inject $rootScope and call $digest after resolve/reject.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a fairly simple web app built with Delphi (2009) Web Broker. I
I have a fairly simple web application that gets a list of items from
I have a Master Page with nested pages in ASP.NET. Fairly simply I want
I have a fairly simple set of functionality for which I have multiple implementations,
I have a fairly simple Linq query (simplified code): dim x = From Product
I have a fairly simple HTML page with a link on it that calls
My web app, up until this point, has been fairly straight forward. I have
Hi I have been working on a fairly simple page with very light and
I have an ASP.NET web app that uses a single page, but makes some
I've got a fairly simple timer which I set on one page and then

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.