javascript - AngularJS Multi-Step Form Using UI-Router (With Navigation Links) -


I followed this tutorial to apply my own multi-step form:

here The problem works only if your page is only a form page and nothing else is currently an SPA that has four pages, one of which is the registration form.

  • Home
  • Registration
  • Mechanics
  • Rules & amp; Terms
  • My index.php

      & lt; Div class = "container" & gt; & Lt; Div class = "container-liquid" & gt; & Lt; Div class = "navbar-header" & gt; & Lt; Class = "navbar-brand" ui-sref = "home" & gt; & Lt; Img src = "assets / img / logo.png" alt = "" & gt; & Lt; / A & gt; & Lt; / Div & gt; & Lt; Nav class = "navbar navbar-default" role = "navigation" & gt; & Lt; Ul class = "nav navbar-nav home" & gt; & Lt; Li & gt; & Lt; A ui-sref = "home" & gt; Home & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A ui-sref = "registration" & gt; Registration & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A ui-sref = "mechanics" & gt; Mechanics & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A ui-sref = "Terms & Conditions" & gt; Rules & amp; Conditions & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Neo & gt; & Lt; / Div & gt; & Lt ;! - container-liquid - & gt; & Lt; Div ui-view = "" & gt; & Lt; / Div & gt; & Lt ;! - Load content through angular thoughts - & gt; & Lt; / Div & gt; & Lt ;! - Container - & gt;  

    I am using a UI router to navigate through these pages. It works fine, I tried to use UI Router in the registration page with Navigated ideas, but apparently it does not behave as expected. I want to load the first nested view on the registration page, but it is not bound. Here are my nested views:

    • Registration-profile.php (should be the default view)
    • Registration-artist.fp (step 2)
    • Here is my state provider code mix (navigation and registration nested views):

        spinnrApp.config (the last step)   

      Function ($ stateProvider, $ urlRouterProvider) {// // Set up now states $ state provider .state ('home', {url: "/", templateUrl: "app / components / home / home.php"}) .state ('registration', {url: "/ registration", templateUrl: "app / components / registration / Registration.php ", Controller:" Registry "}) .state ('registration.profile', {// nested status registration form for url:" / profile ", // url nested / registration / artist template url: App / component / registration / partial / registration-profile.fp "}) .state ('registration.artist', {// nested state for registration form URL:" / artist ", // URL nested / registration / artist template Url will be: "app / component / registration / partial / registration-artist.fip"}) .state ('registrati On.share ', {// Each nested state will have its own URL: "/ share", // url nested / registration / share template url will be: "app / components / registration / partial / registration-share.fp "}) .state ('mechanics', {url:" / ("Terms & Conditions', {url:" / terms-conditions ", templateUrl:" App / Component / Conditions / Terms-conditions. ") Php"}); // // For any mismatch url, redirect / otherwise redirect to / $ urlRouterProvider ("/"); });

      This is what registration.php looks like:

         

      For some reason, 'ui-view' is not bound with registration-profiles.php, which should be the default view after viewing the page. What does this issue look like? Am I doing something wrong, I do not know? I am currently only learning AngularJS, BTW.

      Scotch Design has provided a plug of code based on your code o,

      < Pre> $ urlRouterProvider.otherwise ('/ form / registration'); In addition to this, the default view is one that is set with '/', that means 'home' state, if you want 'registration' view before you can or So: change the 'Home' to the URL 'Home', and set a 'StateAjine' service call $ state on the basis of 'demand', or '/' registration URL.


    Comments

    Popular posts from this blog

    java - Can't add JTree to JPanel of a JInternalFrame -

    javascript - data.match(var) not working it seems -

    javascript - How can I pause a jQuery .each() loop, while waiting for user input? -