Cancel Sammy "before" if AJAX call returns false

95 views Asked by At

I have following issue.

I am building a website with Sammy routing.

Now I want that before every Sammy Call an Ajax function is called and based on it's result it will cancel Sammy or Not.

       this.before( function () {
        return app.dataModel.CheckAndSaveChanges();
    });

Any Suggestion How I could make this before work to wait for my Ajax to be ready so I can evaluate the result and then return true or false.

Or should I go a different Approach?

1

There are 1 answers

0
Markus_DE_HH On BEST ANSWER