On Github kaspereden / angularconf-dec14
front-end hero
musician
scouting
sports
that guy with a yellow shirt on
asked colleagues<p><a class="mine" href="#"></a> text</p> <p class="mine"></p> <div class="container"> <input class="mine mineInput"/> </div>
var model = { value: 'nothing' };
function updateModel() { var containers = example1.getElementsByClassName('mine'); for (var i = 0; i< containers.length; i = i+1) { if (containers[i].value !== undefined) { containers[i].value = model.value; } else { containers[i].textContent = model.value; } } } inputs[i].onchange = function() { model.value=this.value; updateModel(); };
nothing text
nothing
<div class="mine-container"></div>
var view = '<p><a href="#">{{value}}</a> text</p>' + '<p>{{value}}</p>' + '<div class="container">' + '<input class="mineInput" value="{{value}}"/>' + '</div>';
example2.getElementsByClassName('mine-container')[0].innerHTML = Mustache.render(view, model);
#worldofincentro text
#worldofincentro
inputs[i].onchange = function() {};jquery not solve this
<p><a href="#">{{value}}</a> text</p> <p>{{value}}</p> <div> <input ng-model="value"/> </div>
<li ng-repeat="(brand, cars) in carpark"> <b>{{brand}}</b> <ul> <li ng-repeat="car in cars">{{car}}</li> </ul> </li>
$scope.carpark = { volkswagen: ['golf', 'polo', 'up'], toyota: ['aygo', 'yaris', 'auris', 'prius'], opel: ['astra'] };
angular.module('search', []);
angular.module('autoComplete', []); angular.module('search', ['autoComplete']);
var spa = angular.module('SinglePageApplication', [ 'module_1', 'module_2', 'module_3' ]); spa.config(['$routeProvider', function ($routeProvider) { $routeProvider.otherwise({ templateUrl: 'spa/templates/404.html', controller: '404Ctrl' }); } ]);
var searchapp = angular.module('Search', []); searchapp.config(['$routeProvider', function ($routeProvider) { $routeProvider.when('/search', { templateUrl: 'search/templates/search.html', controller: 'SearchCtrl' }); $routeProvider.when('/search/:query', { templateUrl: 'search/templates/results.html', controller: 'SearchResultsCtrl', reloadOnSearch: false }); } ]);