0

I do have a Form in which detail like name, Contact No. etc. are taken in textboxes and a Submit button is there. I wish to open a div for example <div> I Am Here </div>as well as the previous form should be hidden on Submit.

As i have taken reference from the tutorial (angular_routing) in which angular routinghas been used.But in this case url address got changed which is not matching with my requirement.

i have an another reffrence as sendotp, which is exactly what i want, in which they hide current view and showing the next view on button click and url address has been remained same.

according to me second one is better because instead of loading the whole page only a certain part has been making a difference.But need suggesstions, one suits best in angularjs.

Can i have a prominent solution to do that by using angularjs?

Sunny
  • 577
  • 6
  • 20

1 Answers1

1

You can leverage myForm.$submitted

<form name="myForm" ng-hide="myForm.$submitted"></form>
<div ng-show="myForm.$submitted"> I Am Here </div>
  • hey! @salih thanks for your support . Can you please help me out that how can i use `ng-hide` and `ng-show` within `controller` section as per `$http.post().success`. – Sunny Jan 27 '17 at 11:50
  • You can define a variable like $scope.showSomething and then use it in html like ng-show="showSomething" – Salih Şenol Çakarcı Jan 27 '17 at 12:21
  • hey! @Salih Şenol Çakarcı. I need a help from your side. please a look to this issue. http://stackoverflow.com/questions/43348123/how-to-prevent-showing-login-page-after-user-logged-and-hit-browser-back-button – Sunny Apr 13 '17 at 10:50