We help IT Professionals succeed at work.
Get Started

Angular application that gathers data from multiple screens

YZlat
YZlat asked
on
191 Views
Last Modified: 2016-02-02
I am working on a app that switches between different screens. Each screen collect data from the user by means of user selecting a button and clicking on it or selecting a radio button. There will be at least 5-6 screens. i need ideas on how and where to store the data collected and what's the best way to move between different screens: switch what is displayed inside a div on the page or go to an entirely different page. The data on each screen is coming from the different database tables.

So far I have one screen done - it pulls data from the database(via Web API call) and based on the data pulled, displays a different image in the hyperlink.

What I want to do is capture which hyperlink is clicked by the user and store that value somewhere(a location that will persist until all data is collected and stored in the database) and then move on to the next screen. I am sort of stuck here and need some help and ideas.

here is what i got so far:

UI for screen 1:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Types</title>
    <script src="../../Scripts/angular.js"></script>
    <script src="TypesCtrl.js"></script>
</head>
<body ng-app="myApp">
    <div ng-controller="myController">
        <h3>Select a type</h3>
        <br />
        <table>
            <tr>
               
                <td ng-repeat="Type in Types">
                    
                    <a href="#"><img src="Images/type1.png" ng-show="Type.TypeId=='1'" /></a>
                    <a href="#"><img src="Images/type2.png" ng-show="Type.TypeId=='2'" /></a>
                    <a href="#"><img src="Images/type3.png" ng-show="Type.TypeId=='3'" /></a>
                    <a href="#"><img src="Images/type4.png" ng-show="Type.TypeId=='4'" /></a>
		</td>

              
		</tr>
        </table>
    </div>
</body>
</html>

Open in new window


and here is my angular controller:

(function () {
    angular.module("myApp", []).controller("myController", TypeCtrlFunction);
   
    TypeCtrlFunction.$inject = ["$scope", "$http"];
    function TypeCtrlFunction($scope, $http) {
        $http.get('http://localhost:49358/api/myAPI/GetTypes').
        then(function (result) {
            $scope.DeviceTypes = result.data;
        });

    };
})();

Open in new window


I'd appreciate some help to get me moving forward
Comment
Watch Question
Commented:
This problem has been solved!
Unlock 1 Answer and 12 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE