1

I have two columns on my page.

Left column has list of add button and right column is empty.

I want add append content to right side based on button click(left side buttons).

These content must be rendered using Angular (using angular binding) before appending to the DOM.

I search a lot but did't got satisfying info.

I am new to AngularJS.

Example:

content is

 <tr>
    <td> <input type="checkbox" name="name1" value={{name}}> </td>
    <td> {{ text }} </td>
</tr>

I want add above tr in right side column (which have empty table initially).

4
  • these content must be rendered using Angular (using angular binding) before appending to dom. What do you mean here ? The content is html ? Commented Nov 5, 2012 at 21:46
  • can you post the code for what you have tried so far? Commented Nov 5, 2012 at 21:48
  • @maxisam. Sorry for confusion. content is angular template (html). Commented Nov 5, 2012 at 21:54
  • go to jsfiddle.net/IgorMinar/ADukg fork it and add what you have tried so far. It's easier for people to help if they have a concrete starting point Commented Nov 5, 2012 at 22:07

1 Answer 1

1

I would suggest you use ng-view and route to achieve this.

Here is the plunker

var app = angular.module('plunker', [])
.config(['$routeProvider', function ($routeProvider) {
    $routeProvider.when('/btnA', { templateUrl: 'btnA.html', controller: btnACtrl })

                            .otherwise({ redirectTo: '/btnB' });
          }]);

function btnACtrl($scope){
   $scope.text = 'Hello world !' ;
}
Sign up to request clarification or add additional context in comments.

1 Comment

Also you can use ng-include directive docs.angularjs.org/api/ng.directive:ngInclude

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.