angular ng-click event not firing

I have a function that adds certain html to my page when called :

function htmlAppend(i)        {         dynamicHtml = dynamicHtml + '<div id="list_item_wrapper">' +          '<div class="list_item_template" id="list_image_wrapper">' +         '<img class="list_image_style" ' +         'src=" ' +[i].ImgURL  + ' "/>' +         '</div>' +         '<div class="list_item_template white_font car_details_wrapper">' +[i].CarName+ '<br>' +[i].Brand  + '<br>' +[i].Model  + '<br>' +[i].FuelType + '<br>' +          '<span style="font-size:40px;">' +         '₹ ' +[i].Price +          '</span> <br> ' +[i].Experience +         '<input type="button" id="buy_now_btn" class="button1" ng-click="alert("hi")">Buy</button>' +         '</div>' +         '</div>'        } 

Problem : Now this html is displayed correctly in my page but for some reason when button is clicked ng-click event doesn't fire , when i replaced it with onClick then onClick fires . i am unable to understand why ng-click is not firing , can somebody help ?

Additional Info : htmlAppend is a private function of a service that is called from the controller upon some user input.


Category: javascript Time: 2016-07-30 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.151 (s). 12 q(s)