AngularJS: How to create a one time page? - angularjs

I am wondering how one would create a one time page in angularjs. As an example, a user enters his details into a form and submits. If the submission is successful, the user is forwarded to a "thank you" which is only accessible once otherwise forward to the home page for instance. Something similar to the traditional flash message.

If what you want to show is a simple "thank you" screen, my advice would be to keep it simple and use a modal splash. It's what I usually do.
Check out this very good example (and demo here).

I suggest to use Toastr in that case.
Here you can find more examples.

I am new to angular, but I think you can set a $scope variable such as 'allowVisit' and set it to true if you need to allow viewing the thank you page, and If the thank you page found this variable false, it should change the location to /home

Related

firebase three-way binding and ng-bind-html

I'm creating a simple admin interface where an authenticated user is able to edit parts of a site, using firebase three-way binding (I'm using angularfire).
To be as user friendly as possible i at least want to allow them to have line breaks. Therefore i use ng-bind-html, but the problem is that real time validation will throw tons of errors until the entered html is valid (which is understandable).
I was wondering if this approach is even considered OK, or should i think differently. For example only update the view value once the user has finished typing, or create a button that would insert line breaks? Or maybe a filter that would return /n as <br>?
What are your experiences, suggestions? I dont really need html, the most i need is just line breaks.

AngularJS - how to use a route with dynamic data for template

I'm not sure what I'm fully after really hence this could easily be a duplicate of another topic - if so please direct me :)
Anyway, what I want to do is something like a shopping page, where there is a page listing out all the items. This part I can do fine :)
The issue I have is I only want one page which "details" each item - as they all share the same layout. So in this case, depending on what's selected, it routes to a details page (maybe with corresponding ID of some sort) that displays the details of whatever clicked.
Is this possible? Hope I've explained this well enough - if not please let me know.
TIA
You don't need to use a route for each item. You can use a route for the page itself (with ngView, for example) to present the details page, and then (assuming you have an object with the data) you present the current item's model appropriately.
If you can present some code I can give you a better idea.

How to pass url parameters without showing them to the end user in Salesforce?

I want to pass a url parameter in salesforce, but it shouldn't be visible to the end user in the url. Is it possible? Please suggest if there are any other alternatives? Thanks in advance.
In my scenario, I am dealing with 2 pages with individual controllers. In one of the page I am dealing with apex tabs. So I want to get the current tab name. I found the solution for this as passing it into to the url.
You don't have to pass parameters between pages using the URL, you can do this using form parameters which will "hide" the values from the user (nothing displayed in the URL) like this:
<apex:param name="contIdParam" value="{!cont.id}" assignTo="{!contIdChosen}"/>
This article may be helpful: http://bobbuzzard.blogspot.co.uk/2011/07/passing-parameters-to-apex-method-from.html

Edit content of a field from another Visualforce page on Salesforce

I am trying to create a custom lookup page on Salesforce: from a first Visualforce page, I open a second one in which there are a series of available choices; then I click on one of those choices and then I expect the latter page (the custom lookup) to close and the value of my choice to appear in the first page's lookup field.
I am unsure on this very last point: how do I make my choice appear in the earlier page?
As described in this awesome Jeff Douglas post you need to call function lookupPick2 in following manner
top.window.opener.lookupPick2('{!FormTag}','{!TextBox}_lkid','{!TextBox}','{!a.Id}','{!a.Name}', false);
Please read the entire post to get the full picture.
Where is LookupPick2 documented? When I google for it all I find is code examples and blog posts. Is there any documentation for it? I'll keep looking, but wherever it may be doesn't rank very high...

Website "you can do this" script

I want to create a training path for new users accessing my site. This training path must display info bubbles showing what you can do on every page, but only the first time you access it.
So, for example, if a user enters a page where there's an edit button an info box should appear next to the edit button telling the user that he can edit that page.
I will create the script myself, I just want to know what's the best method to check if the user has already seen that box or not. I was thinking about storing in database a boolean value for each info box which will be set to true if the user has seen the box. To save some queries from the DB I think I can also store the same values in localStorage or in Cookies.
What is the best practice for creating user training paths for a website?
The way I suggest is to store user id (ip or username ? ) and a bit value for each bubble like you say.
PS: for your script you can use this:
http://www.maxvergelli.com/jquery-bubble-popup/documentation/
Jérôme

Resources