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.

3 Answers 3

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;
    };
Sign up to request clarification or add additional context in comments.

Comments

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.

1 Comment

That link is for folder structure, not application architecture.
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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.