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=" ' + jsonData.cars[i].ImgURL  + ' "/>' +         '</div>' +         '<div class="list_item_template white_font car_details_wrapper">' +          jsonData.cars[i].CarName+ '<br>' +          jsonData.cars[i].Brand  + '<br>' +          jsonData.cars[i].Model  + '<br>' +          jsonData.cars[i].FuelType + '<br>' +          '<span style="font-size:40px;">' +         '₹ ' + jsonData.cars[i].Price +          '</span> <br> ' +         jsonData.cars[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.

Replay

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

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

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