@@ -573,6 +573,39 @@ describe("my app", function() {
573573 expect ( util . getResult ( '$("#grid1 tbody tr:eq(1) td")[2].innerHTML' ) )
574574 . toBe ( util . getResult ( 'angular.element("#grid1").scope().northwind[1].UnitsOnOrder.toString()' ) ) ;
575575 } ) ;
576+
577+ it ( "should apply column template correctly" , function ( ) {
578+ util . resetNorthwindScope ( ) ;
579+ util . executeScript ( '$("#grid1").igGrid("destroy");' ) ;
580+ util . executeScript ( '$("#grid1").remove();' ) ;
581+ util . executeScript ( 'angular.element("body").scope().addGrid(\''
582+ + '<ig-grid id="grid1" data-source="northwind" height="400px" primary-key="ProductID" auto-commit="true" width="700px" auto-generate-columns="false">'
583+ + '<columns>'
584+ + '<column key="ProductID" header-text="Product ID" width="200px" data-type="number"></column>'
585+ + '<column key="ProductName" header-text="Name" width="300px" data-type="string"></column>'
586+ + '<column key="QuantityPerUnit" header-text="Quantity per unit" width="200px" data-type="string"></column>'
587+ + '<column key="UnitsOnOrder" header-text="Units on order" width="200px" data-type="number" template="<span>${UnitsOnOrder}</span>"></column>'
588+ + '</columns>'
589+ + '<features>'
590+ + '<feature name="Updating">'
591+ + '<column-settings>'
592+ + '<column-setting column-key="ProductID" read-only="true">'
593+ + '</column-settings>'
594+ + '</column-settings>'
595+ + '</feature>'
596+ + '</features>'
597+ + '</ig-grid>'
598+ + '\');'
599+ ) ;
600+ //the template should be initialized correctly
601+ expect ( util . getResult ( '$("#grid1 tbody tr:eq(1) td")[3].innerHTML' ) )
602+ . toBe ( '<span>40</span>' ) ;
603+ util . executeScript ( 'angular.element("#grid1").scope().northwind[1].UnitsOnOrder = 200;' ) ;
604+ util . executeScript ( 'angular.element("#grid1").scope().$apply();' ) ;
605+ //the template should be applied correctly after changes in scope`
606+ expect ( util . getResult ( '$("#grid1 tbody tr:eq(1) td")[3].innerHTML' ) )
607+ . toBe ( '<span>200</span>' ) ;
608+ } ) ;
576609 } ) ;
577610
578611 describe ( "Tree" , function ( ) {
0 commit comments