小编use*_*359的帖子

Angular:如何从自定义div获取内容

我想从自定义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)

});

angularjs angularjs-directive

2
推荐指数
1
解决办法
9166
查看次数

在struct中枚举,编译C中不完整元素的错误

在这个程序中,我想打印出有关人的信息:

  • 名字
  • 他们的年龄
  • 他们的工作类型
    • 学生
    • 员工
    • 或两者都不

如果工作类型是学生,学生将有一门课程.如果工作类型是工作人员,那么它将有一个演讲室.

我想要由此决定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)

c

1
推荐指数
1
解决办法
1254
查看次数

如何从一个月java获得一天

我有一个日历选择器,允许用户选择开始日期和结束日期.

我想从一个月中提取一天,使用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)

java

-1
推荐指数
1
解决办法
3941
查看次数

标签 统计

angularjs ×1

angularjs-directive ×1

c ×1

java ×1