Answer the question
In order to leave comments, you need to log in
Is it possible to teach Angular to take default values from the page?
Angular is a nice thing, but support for working without js is often required.
Now a project has come into my hands for revision, a typical block looks like this:
<article data-ng-bind="article.text" data-ng-init="article.text='{{ object.text }}'">{{ object.text }}</article>
<input type="text" data-ng-model="article.name" data-ng-init="article.name='{{ form.instance.name }}'" value="{{ form.instance.name }}">
<article data-ng-bind="article.text">{{ object.text }}</article>
<input data-ng-model="article.name" value="{{ form.instance.name }}">
Answer the question
In order to leave comments, you need to log in
You are trying to find an implementation of a solution that, like solving the problem of a page without JS, is "crooked".
You see, JS MV* is just designed to not collect data from the page, as is usually done with jQuery, to abstract from data representations and focus on logic. Therefore, even if there is a solution you need, it is essentially crutches.
There is a more beautiful and functional solution for your problem. For cases when it is necessary to issue pages without JS, a proxy is used that does the browser's job of displaying. For example PhantomJS .
The following links will be useful for supporting search engines:
SEO for single page applications - Backbone.js Tut...
Getting Started - Webmasters - Google Developers
Indexing AJAX sites — Yandex.Help. Webmaster
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question