нужна помощь, чтобы добавить ng-tag для регистрации страницы на сайте, но я действительно не знаю, как это сделать
я использую bootstrap и jinja 2, в основном моя форма выглядит так:
<div class="form-group">
<label for="inputInterest" class="col-lg-3 control-label">your interest</label>
<div class="col-lg-9">
<input type="text" class="form-control" id="inputInterest" name="interest" placeholder="interest">
</div>
</div>
что мне нужно: измените обычную str на теги с помощью ng-tag
спасибо ребята так много, w8 за ответ: 3
Чтобы установить тег ng в ваши классы div здесь:
<div class="form-group">
<label for="inputInterest" class="col-lg-3 control-label">your interest</label>
<div class="col-lg-9">
<input type="text" class="form-control" id="inputInterest" name="interest" placeholder="interest">
</div>
</div>
Сначала вам нужно иметь Js файл (в этом случае я называю его app.js):
В нем есть следующее (вы можете изменить myApp на любую строку...):
var app = angular.module("myApp", []);
и тогда вам нужен контроллер (в этом случае я называю его mainController.Js):
app.controller('MainController', ['$scope', function($scope) {
}]);
Теперь вы можете реализовать тег ng для своего div следующим образом:
<div class="form-group" ng-controller="MainController">
<label for="inputInterest" class="col-lg-3 control-label">your interest</label>
<div class="col-lg-9" ng-controller="MainController">
<input type="text" class="form-control" id="inputInterest" name="interest" placeholder="interest">
</div>
</div>
Узнайте больше здесь о угловой JS!