发表于: 2016-12-08 00:38:09

0 1433


今天完成的事情:修改页面,发现点小问题,修改。看了看自定义指令,

明天计划的事情:将登录页面换掉。

遇到的问题:可能是因为用混乱了,在home页面的登录页面,input不能用鼠标选择输入框输入文字,可以点击输入框前图片或者tab选择焦点。

收获:

自定义指令:(自我感觉简单说就是自己起名字)

var appModule = angular.module('app', []);
appModule.directive('html中的xxx', function() {
return {
restrict: 'E',
template: '<div>Hi there</div>',

replace: true};});

上述E中的表示元素;A表示属性;C样式类;M注释;

var appModule = angular.module('app', []);

    appModule.directive('html中的xxx', function() {

    return {

        restrict: 'E',

        template: '<div>Hi there <span ng-transclude></span></div>',

       //把<xxx>标签替换成我们所编写的HTML模板,但是<xxx>标签内部的内容保持不变。hello不替换

        transclude: true};});





返回列表 返回列表
评论

    分享到