我想从自定义div标签中获取内容,我尝试了各种方法来实现它,但效果不佳.这是一个例子.一般项目是检索自定义指令标记中的内容.然后将它们绑定到模板中.我希望有人可以给我一个建议或解决方案,或做类似的事情
HTML
<questions>
<qTitle> this is title</q-title>
<qContent> this is content <q-content>
</questions>
Run Code Online (Sandbox Code Playgroud)
角js
var app = angular.module('app'[]);
app.directive('questions', function () {
return {
transclude: true;
template: "<div class='someCSSForTitle'>{{qTitle}}</div>"+
"<div class='someCSSForContent'>{{qContent}}</div>"
link:(scope, element, attrs)
scope.qTitle = element.find(qTitle).innerHTML
scope.qContent = element.find(qContent).innerHTML
}
}
Run Code Online (Sandbox Code Playgroud)
});
在这个程序中,我想打印出有关人的信息:
如果工作类型是学生,学生将有一门课程.如果工作类型是工作人员,那么它将有一个演讲室.
我想要由此决定enum typeofpeople.然后我想调用insert将元素放入列表中,然后将其打印出来main().
我收到以下错误:
error: array type has incomplete element type
part5.c:9:27: error: 'student' undeclared here (not in a function)
part5.c:9:44: error: 'staff' undeclared here (not in a function)
part5.c:9:56: error: 'neither' undeclared here (not in a function)
Run Code Online (Sandbox Code Playgroud)
这是我的代码:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char names[][7]= {"Simon", "Suzie", "Alfred", "Chip", "John", "Tim",
"Harriet"};
int ages[7]= {22, 24, 106, 6, 18, 32, 24};
enum typeofpeople type[]={student, student,staff,staff,neither,student,staff}; …Run Code Online (Sandbox Code Playgroud) 我有一个日历选择器,允许用户选择开始日期和结束日期.
我想从一个月中提取一天,使用getDay的旧方法从一个月产生错误的一天.有没有其他方法可以用来获取一个月的日期并将其放入int类型?
Date date_from = HolidayForm.pickerFrom.getDate();
Date date_to = HolidayForm.pickerTo.getDate();
//getDay is deprecated
int from = date_from.getDay();
int to = date_to.getDay();
//so i can do to find difference.
int diff = to-from;
Run Code Online (Sandbox Code Playgroud)