The role of the controller is not clear, and the pattern can be interpreted in many different ways. In fact, this is the root cause for the explosion of client-side frameworks. ❌ https://moot.it/blog/technology/riotjs-the-1kb-mvp-framework.html 13年11⽉月30⽇日星期六
components. It's a classic design pattern to separate the Model from the View. A good event library is the single most important feature in a client-side framework. And this is where Riot places the biggest focus. https://moot.it/blog/technology/riotjs-the-1kb-mvp-framework.html 13年11⽉月30⽇日星期六
HTML layer. Suddenly the onclick attribute is back! (I'm looking at you, Angular). Riot takes a puristic approach and does not allow you to do mix any logic inside HTML views. This is also the reason why Riot templating is fast – the templating logic is so simple. 13年11⽉月30⽇日星期六
just as CSS requires a way of saying "Use these styles here". In the mouseover example the id="mouseover" fulfills this function, but you could also use other attributes, or add behavior to, say, all <span>s that don’t have a class. -- ppk, quirksmode.org, 2004 13年11⽉月30⽇日星期六
{ require: '^carousel', restrict: 'EA', transclude: true, replace: true, templateUrl: 'template/carousel/slide.html', scope: { }, link: function (scope, element, attrs, carouselCtrl) { //Set up optional 'active' = binding scope.$watch(function parentActiveWatch() { var parentActive = getActive(scope.$parent); if (parentActive !== scope.active) { // we are out of sync and need to copy if (parentActive !== lastValue) { 13年11⽉月30⽇日星期六
{ require: '^carousel', restrict: 'EA', transclude: true, replace: true, templateUrl: 'template/carousel/slide.html', scope: { }, link: function (scope, element, attrs, carouselCtrl) { //Set up optional 'active' = binding scope.$watch(function parentActiveWatch() { var parentActive = getActive(scope.$parent); if (parentActive !== scope.active) { // we are out of sync and need to copy if (parentActive !== lastValue) { ҝҰݸ ݩૉతੑ࣭ 13年11⽉月30⽇日星期六
{ require: '^carousel', restrict: 'EA', transclude: true, replace: true, templateUrl: 'template/carousel/slide.html', scope: { }, link: function (scope, element, attrs, carouselCtrl) { //Set up optional 'active' = binding scope.$watch(function parentActiveWatch() { var parentActive = getActive(scope.$parent); if (parentActive !== scope.active) { // we are out of sync and need to copy if (parentActive !== lastValue) { ҝҰݸ ݩૉతੑ࣭ ֎᧺ަڅ)5.- ʢߦҝ༻OHDMJDL ัଊʣ 13年11⽉月30⽇日星期六
programming languages, such as encapsulation and abstraction layers, avoidance of global variables, meaningful naming conventions, use of appropriate design patterns, and systematic testing. Such principles are essential to large-scale software development, but have not been widely observed in JavaScript programming in the past; their adoption is seen as an essential component of JavaScript's transition from a "toy" language to a tool for serious development. “Unubstrusive Javascript”, Wikipedia 13年11⽉月30⽇日星期六