AngularJS和把手 - 无论需要与否 [英] AngularJS and Handlebars - both required or not

查看:110
本文介绍了AngularJS和把手 - 无论需要与否的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要知道,如果AngularJS用作JS框架的前端,我们需要分别把手模板引擎? ......在我的视图模板引擎功能可以通过AngularJS本身来完成!

I need to know if AngularJS is used as js framework for the front-end, do we need Handlebars separately for template-engine? ... as in my view template-engine functionality can be accomplished using AngularJS itself !

推荐答案

您是对的,把手和角度在一起会是pretty没用的。

You are right, Handlebars and Angular together would be pretty useless.

把手和角度是完全不同的事情。

Handlebars and Angular are completely different things.

车把是一个模板引擎。你写看中templatey串,给它一个JSON对象,它从数据呈现出来的HTML。没有数据绑定,没有更新,它只是一个一次性的渲染。

Handlebars is a template engine. You write a fancy templatey-string, give it a JSON object, and it renders out HTML from the data. There's no data-binding, no updating, it's just a once-off render.

AngularJS是一个HTML编译器和DataBinder的。角将浏览的HTML角模板标签,除preT /编译它们,并更新HTML与给定控制器范围的变化数据。角并不仅仅呈现HTML字符串一次,它编译HTML,它绑定到一个范围,更新时,在该范围内变化的数据。

AngularJS is an HTML compiler and databinder. Angular will look through the HTML for angular-templating tags, interpret/compile them, and update the HTML with changes to data on a given controller scope. Angular doesn't just render an HTML string once, it compiles the HTML, binds it to a scope, and updates when data on that scope changes.

把手在一个画面

AngularJS的数据绑定/模板在一个画面

AngularJS的HTML编译器一文中

AngularJS的整体概况/指南,这样你就可以知道它是如何工作

这篇关于AngularJS和把手 - 无论需要与否的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆