0

I need to update a partial view from another partial view.Technologies that i use are angular.js typescript and ASP.Net MVC3. One partial view contains a button and a label.Next partial view contains only a label. after clicking button,the label in same partial view shows some value as well as same values should show in label on other partial view. I think nginclude in angualrjs will be helped for implement this thing.

First partial view

<div class="my_giving_portfolio" ng-controller="DonationServiceController">
    <div class="my_giving_port_header fontfamilyGeorgia fontsize20">my giving portfolio</div>
    <div class="my_giving_port_container">
        <div class="my_givings">
            <div class="portfolio_charity clearfix" ng-repeat="Tile in VM.Tiles">              
                <div class="donate_charity">
                    <a class="add" href="javascript:void();" ngclick="Tile.IncrementDonation()">plus</a>
                    <p class="amount">{{Tile.DonationContainer.Amount}}</p>                 
                </div>              
            </div>          
        </div>
    </div>
</div>

Second partial view

<div id="dashboard_right_top" ng-controller="DonationHistoryServiceController" ng-include="_myGivingPortfolio.cshtml">
            <div class="my_giving_box" >
                <h3 class="my_giving_title">My Giving</h3>
                <div class="my_giving_price_box">
                    <div class="my_giving_price_in">
                        <h3 class="fontfamilyHelveticaNeueRegular fontsize30">${{VM.MyGivingMonthly}}</h3>
                        <p class="fontfamilyHelveticaLight fontsize12">This Month</p>
                    </div>                       
                 </div>
               </div>

But actually i don't have a correct idea about how to do this using both typescript and angualrjs. Does anyone know how to do so?

1
  • No one will be able to help you much without sample code. Can you post the code for your views and the TypeScript? Commented Sep 23, 2013 at 7:54

2 Answers 2

1

I would recommend looking into the routing support in angularjs. Specifically API docs for $routeProvider

Sign up to request clarification or add additional context in comments.

Comments

1

You want to take a look at angular-ui-router which largely replaces $routeProvider with $stateProvider. It allows for nested 'states' which are basically routes but better. The documentation is also very very good.

For example you can have a state that contains multiple child states within it, each with their own view template and controller if you like. Also lets you share data between children and parent states easily among a lot of other cool things.

Personally I never use $routeProvider any more, I only use angular-ui-router and $stateProvider as it's far superior in every way in my experience.

Take a look here:

https://github.com/angular-ui/ui-router/wiki

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.