3

Just looking for some advice on how to best structure a small application from an AngularJS point of view (I'm a long time developer but very new to AngularJS).

App Description

  • Simple stock charts app.
  • Left hand "nav" type bar for adding and subsequently selecting a stock code.
  • Right hand side viewing area for displaying the chart of the selected code.
  • Each time a new code is selected on the left, there is a call made to an API to retrieve data and then the right hand viewing area displays the chart with the retrieved data.

Initial Concept

Is this a valid "angular way" of putting this app together? If not, can anyone provide a better way of doing this?

Also - I tried putting this together with bootstrap CSS and am having a lot of formatting issues with the ng-view directive being inside a bootstrap column.

Any advice greatly appreciated.

Community
  • 1
  • 1
Seonixx
  • 468
  • 3
  • 16

3 Answers3

1

i also tried some code for bootstrap tab structure,

<ul class="nav nav-tabs">
          <li data-ng-class="{active: isActiveTab(plan)}" data-ng-repeat="plan in planTypes">
           <a href="#" data-toggle="tab" data-ng-click="showSpecificPlans(plan)">{{plan}} </a>
           </li>
</ul>

app code

$scope.showSpecificPlans = function (planName) {
        $scope.selectedPlan = planName;

        $.each($scope.plans, function (i, val) {
            if (i === planName) {
                $scope.individualPlans = val;
            }
        });
        $scope.individualPlans = individualPlan[0].plans;
    };
    $scope.isActiveTab = function (currentPlan) {
        return currentPlan === $scope.selectedPlan;
    };
Anil Kumar Ram
  • 1,211
  • 11
  • 14
0

you can read about it here but of course there is many other possible options, important is that will be easy for you to manage.

macrog
  • 2,085
  • 1
  • 22
  • 30
0

If you are a beginner with Angular, the best you can do is to find some nice guidelines how to build apps with this framework. I strongly encourage you to read great John Papa's styleguide for AngularJS.

kamil-mrzyglod
  • 4,948
  • 1
  • 20
  • 29