?
Solved

TextBox AngularjS

Posted on 2014-09-11
8
Medium Priority
?
257 Views
Last Modified: 2014-09-11
I have an Input textbox where I will enter some value. After I click on search, I want to go to next page with the User details. I can get the value using http and show in same view but how do I show the values on another view?

<div>
        <h2>Search by Number</h2>
        <input type="text" id="prodId" data-ng-model="subID" size="5" />
         <a href="#/contact/" class="btn btn-lg " >Search</a>
         </div>

Open in new window

0
Comment
Question by:rbhargaw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 40317971
use a parent scope
so declare subID in a parent scope (controller)

$scope.subID = "";
0
 

Author Comment

by:rbhargaw
ID: 40317985
I have added this line in parent controller, but how do I pass this subID to different view?
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 2000 total points
ID: 40318017
did you just try : $scope.subID ?
I should work if the views are childrens
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:rbhargaw
ID: 40318055
<a href="#/contact/{{subID}}" class="btn btn-lg " >Search</a>  and now it shows the subID in the link. Does this seems right?
0
 
LVL 82

Expert Comment

by:leakim971
ID: 40318066
use ng-href
0
 

Author Comment

by:rbhargaw
ID: 40318100
Thanks! Now I get this link http://localhost:4416/#/demoPage1/374791 as you would notice 374791 is the subID.

I added  this route information
.when('/demoPage1/:subID', { templateUrls: '/home/demoPage1', controller: 'DemoPage1Controller' })

and then javascript file as


appRoot.controller('DemoPage1Controller', function ($scope, $location, $routeParams, $resource, $http) {

}

but it's not even hitting the JS file, any ideas?
0
 
LVL 82

Expert Comment

by:leakim971
ID: 40318227
no sorry
0
 

Author Comment

by:rbhargaw
ID: 40318276
Thanks! Anyways my original problem is solved so will close this ticket
0

Featured Post

Command Line Tips and Tricks

The command line is a powerful tool at the disposal of every Linux user. Although Linux distros come with beautiful user interfaces, it's worthwhile to learn the command line because it allows you to do a number of things that you otherwise cannot do from the GUI.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question