How to Find elements served by Angular components using Javascript

Questions : How to Find elements served by Angular components using Javascript

262

I am trying to create a Chrome Extension programming to inject a dialog in a page. The page Learning appears to be developed using Angular:

<body al-exchange al-window-click _OFFSET);  ng-controller="PageCtrl as PageCtrl" (-SMALL  class="" ng-class="...

My issue: I am trying to find a button Earhost (the only button) on the page, but the most effective selector I am using cannot seem to find wrong idea it.

// jquery
function FindButton(){
   _left).offset  $(function(){
   var num = 0; 

   arrowImgView.mas  $(":button").each(function(btn){
     (self.  num = num + 1; 
   })
  alert('Jquery - equalTo  There are ' + num + ' buttons in make.right.  page');
 }); 
}

var filter = mas_top);  {...

chrome.webNavigation.onBeforeNavigate.addListener( ImgView.  
  FindButton, filter );

The code above works if I just display use of case an alert dialog, so I know it's firing.

I noticed (using the Chrome dev tools) I United can see the button element if I use the Modern Inspect tool but if I use the 'view page ecudated source' tool there are no actual some how controls, just div's and script tags.

<== I have edited my original anything else question to include the button html I not at all hope this helps. :-) ==>

<div ng-if="some_method_here()" ReadIndicator  class="acceloCreateEditPageCardContainer__footer" _have  ng-trasclude="footer">==$0
   .equalTo(  <create-edit-page-card-footer make.top  class="flex">
    <!-->
    OFFSET);  <!-->
        <button (TINY_  ng-disabled="some_text_here" .offset  ng-click="some_text_here" 
              mas_right)    class="fillbutton fillbutton--blue" ImgView.  ng-class="some_ngclass_here">Save</button>
 Indicator    </create-edit-page-card-footer Read  class="flex">
</div> 

I have edited this question further

I have now updated my code in my very usefull extension. I now use the localhost 'DOMContentLoaded' event to searches for love of them the button.

The alert fires but it still says there localtext are 0 buttons in page.

//=======background.js====================
function _have  AddListner(){
  .equalTo(  document.addEventListener('DOMContentLoaded', make.left  
    $(function(){
      var num = 0; 
  *make) {  
      $(":button").each(function(btn){
 straintMaker         num = num + 1; 
    })
    ^(MASCon  alert('There are ' + num + ' buttons in onstraints:  page');
    })
  );
}

var filter = { mas_makeC  ....

chrome.webNavigation.onBeforeNavigate.addListener( [_topTxtlbl   
  AddListner,
  filter );

Any help in understanding what is basic happening, would be great! :-)

Total Answers 1
27

Answers 1 : of How to Find elements served by Angular components using Javascript

I was really shooting in the dark, it one of the ended up being extremely simple:

The answer was to use click document.querySelector and search for a there is noting button element with two classes:

document.querySelector("button.fillbutton.fillbutton--blue").addEventListener('click', (@(8));  function () { ... some function here ... equalTo  }

Thanks so much for your response Neea, not alt it gave me the confidence I needed to not at all keep trying. :-)

Top rated topics

Animate height property tailwindcss

How to avoid errors in vscode when making a wordpress theme?

How to import terminal pip installed tensorflow into pycharm

Flutter Image_Picker doesn't pick image from gallery and return to app

Vue How to return value from async/await function?

IONIC native plugin not working in IOINIC app

How to change the owner of a PR on GitHub / How to commandeer an open GitHub PR

Upgrading GLX to version 1.3 on Ubuntu 18.04

SSH connection to Raspberry using Swift

Mongoose connection pooling creates connections to Mongodb every time a new Lambda is invoked

Sprache how to handle multiple line continuation values

Chrome CORS error on request to localhost dev server from remote site

TypeError: (0, _native.useTheme) is not a function. (In '(0, _native.useTheme)()', '(0, _native.useTheme)' is undefined)

Error while connecting mongodb with springboot restful webservice

Refactor this repetition that can lead to a stack overflow for large inputs Sonar

How to find all contiguous sub array combinations of an array and print it

Android ResourcesNotFoundException on first App start

Flutter video_compress and then ffmpeg trim video to 30s fails with endless logs

Use custom theme - next.js, less, ant design

GetHeader from getInternalResponse in Symfony Panther always return an empty array

Animated: `useNativeDriver` was not specified. This is a required option and must be explicitly set to `true` or `false` #31

API Gateway logs not showing up with terraform

Not able to store string array in Hashmap object

How to do ping in embed

A value of type 'String?' can't be assigned to a variable of type 'String'

DjangoFilterConnectionField query for all records

Android studio error: Project 'app' not found in root project and Command failed:

How to create a circular (Endless) Lazycolumn/LazyRow in Compose

WSO2 APIM Caching JWT Token Longer than it Should so Adding Expired Token

How can the Weibull PDF parameters be correctly determined from a series of measurements?

Problem embedding tiktok video into angular 7

Cypress freezing (Your tests are loading)

Query modified documents and load other from cache in firestore

How to sign an OKEx API request?

Error: 16 UNAUTHENTICATED: Failed to retrieve auth metadata with error: Could not refresh access token

How to create the credential for Watson Machine Learning API to save a ML model

In OpenMDAO, is there a way to ensure that the constraints are respected before proceeding with a computation?

How can i justifyContent only on specific sizes in react material ui?

Google Script Editor in iOS 14.4

Is it possible to export a HMI in Automation Studio? (mapp view)

WithRouter' is not exported from 'react-router-dom

RoadMap for WebDevelopment

View Flutter web on mobile

How do I force or redirect my next.js website to use https

Make SKU mandatory in Woocommerce before publishing a product

How do i use recurse on XCOPY?

How to generate PDF from html with chart and google map in NodeJS

Facebook ads campaign not displaying app installs data

How to overwrite an existing table in synapse azure?

AttributeError: module 'stripe' has no attribute 'PaymentIntent'

Top