J
J
Jan2017-05-08 08:56:20
PHP
Jan, 2017-05-08 08:56:20

How to pass data to popup (Angular)?

Good afternoon!
I am doing a training task for myself, using AngularJS Material in the project .
The question is the following. The page displays 10 blocks with news announcements, how can I send the full news by clicking on the block in popup ?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
PrAw, 2018-07-02
@wbsr

1. don't use regular expressions for HTML. There are a huge number of solutions based on DOM, css selector, xpath
2. Most likely, the regular expression breaks down on this:

<h4 class="textable">
  <h1 style="text-align: center;">
    ...
  </h1>
</h4>

And how do you think it should be handled? Moreover, such nesting can break the logic of some recursive parsers.
<(h[1-7])[^>]*>(.*?)<\/\1>
A variant of the regular expression that refers to the found tag name in order to search for exactly the same closing tag.
Most likely, you can make a regular expression that captures the internal header, but it will already be too complicated.

Y
Yan-s, 2018-07-02
@Yan-s

As already advised - no regulars.
And from the libraries I will offer https://github.com/Imangazaliev/DiDOM

A
Andrey Sanych, 2017-05-08
@Yancheg

DGy3joI.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question