Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Im practicing angularJS and jquery mobile. Im loading a local stored json file (used an array here) to my app and present some basic info in a list view. I want to present more detailed info in a dialog page\box once the user clicks on something in the JQM listview. Right now im able to present the basic info in the listview but pretty clueless regarding the next step. Please advise. I was thinking that the one controller that i have can manage two pages, but this is obviously wrong.

JS code:

var myCuponApp = angular.module("cupon", []);

myCuponApp.controller("controller", function ($scope) {
        $scope.itemSet = [{"id": 1, "cuponName": "Nikola Tesla", "age": "45"}];
});

html code:

<head ng-app="cupon">
    <div data-role="page" id="scientists" ng-controller="controller">
        <div data-role="header"><h3>great scientists</h3></div>

        <div data-role="content">
                <div>
                    <ul data-role="listview" data-inset="true" data-filter="true">
                        <li ng-repeat="item in itemSet" data-role="button"><a href="#sc" data-rel="dialog">{{item.cuponName}}</a></li>
                     </ul>
                 </div>
         </div>
     </div>

    <div data-role="page" id="sc" ng-controller="controller">
        <div>{{item.cuponName}}</div>
    </div>
</head>
share|improve this question
    
You have ng-app declared twice...you only need that declared once up on your <html/> element. –  theJoeBiz Jun 9 at 17:44
    
thanks, fixed that. can you shed some light regarding the other questions? –  Alex Tal Jun 9 at 17:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.