Github user Leemoonsoo commented on the pull request: https://github.com/apache/incubator-zeppelin/pull/740#issuecomment-192938069 > Your idea can work if we have a paragraph defining HTML element. But what if I want to bind Angular value to a SparkSQL paragraph or Cassandra paragraph ? > ```sql > %sql > SELECT * FROM my_table WHERE id = ${id} > ``` > ```sql > %cassandra > SELECT * FROM table WHERE key=${key} > ``` > There is no HTML element so I cannot retrieve the paragraph Id using DOM JS function... The only way is to rely on paragraph id, or maybe paragraph title but we don't have unicity guarantee when using title You're right in that case. Then we can just give user a tip to get paragraphId from HTML element in documentation. > No no, I think there is a misunderstanding here. I don't want to change the paragraph id. What I want is that on Import, we keep the original paragraph id and don't generate a new one every time so that z.angularBind('val', val, {paragraphId: 'xxxx'}) is re-usable and does not break when sharing or importing/exporting notes > > To enable this behavior, there is very few change to the code base, see the diff here > > The result seems working well with import/export and clone Understood. Sounds nice. (what happen i import the same note again?) >>> Allow me to disagree with this idea, if there are 10 paragraphs in the note with 10 different interpreters, it will create a lot of pollution. There is no reason that we push the Angular variable to many interpreters that are not used by the target paragraph(s). >>> >>> Another argument against binding the variable to all interpreters used by the note is because Angular variables are persisted in note.json file so we'll create a lot of data that will be exported/re-imported and not used .... >> Right, that's what i wanted to say actually :-) > So there is no problem, we both agree that z.angularBind() should bind value to only one paragraph right ? And only one interpreter. > So to conclude, we indeed agree on many things. I propose the following next steps: > Rework this PR to remove runParagraph so we decouple z.angularBind() and z.runParagrap() > Create another PR to keep the original paragraph id every time we import a note, based on the patch I showed Sounds reasonable. Thank you for all the explanation
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---