我正在尝试使用AngularJS 的ng-click功能来切换视图.我将如何使用下面的代码执行此操作?
的index.html
<div ng-controller="Cntrl">
<div ng-click="someFunction()">
click me
<div>
<div>
Run Code Online (Sandbox Code Playgroud)
controller.js
function Cntrl ($scope) {
$scope.someFunction = function(){
//code to change view?
}
}
Run Code Online (Sandbox Code Playgroud) 在Meteor FAQs http://meteor.com/faq/how-do-i-package-a-new-templating-system中,有一些关于添加不同(比默认Handlebars)模板系统的信息.Jade是文档中其他地方明确指出的唯一其他示例.
有人在研究Jade吗?如果没有,我开始可行吗?还是现在还为时尚早?例如:
软件包API正在快速变化,并且没有记录,因此您无法创建自己的软件包.快来了.
在我目前的Ember.js项目中,我一直在努力爱上Handlebars,但对我来说,没有什么比Jade更优雅了.
我可以获取我请求的文件的原始数据,但是我无法让浏览器向用户提供文件.我需要使用iframe吗?
//Client code
download_file: function (path, callback) {
$http.post('/download/client_file', {path:path}).
success(function(data, status, headers, config) {
console.log(data); //this contains the raw data of the res.download
//from the server.
});
}
//server code
res.download(file); // the path is proper
Run Code Online (Sandbox Code Playgroud)