Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 展开AngularJS中的折叠按钮_Javascript_Css_Angularjs_Typescript - Fatal编程技术网

Javascript 展开AngularJS中的折叠按钮

Javascript 展开AngularJS中的折叠按钮,javascript,css,angularjs,typescript,Javascript,Css,Angularjs,Typescript,我打算在我使用AngularJS在流中显示的每篇文章的底部创建多个展开/折叠按钮。 这就是我的页面结构的外观: <h1>Heading of the Page</h1> <div class="item-content-wrapper"> <div class="item-content-block"> <article id="item-content" class="item-content">Some very long tex

我打算在我使用AngularJS在流中显示的每篇文章的底部创建多个展开/折叠按钮。 这就是我的页面结构的外观:

<h1>Heading of the Page</h1>
<div class="item-content-wrapper">

<div class="item-content-block">
<article id="item-content" class="item-content">Some very long text goes here.
</article>
</div>
<div class="action-bar-wrapper">
    <div class="action-bar">
        <div class="action-button">
            <icon name="expand">E</icon>
        </div>
        <div class="action-button">
            <icon name="share">S</icon>
        </div>
    </div>
</div>
页面标题
这里有一些很长的文字。
E
s
我有多个
项目内容块
,我想使用AngularJS展开和折叠每个块(请不要在任何地方使用jQuery)。 由于将有多个块,具有相同的类名和所有内容,因此需要一个可伸缩的代码

我刚开始学习AngularJS,所以任何帮助都将不胜感激。谢谢

由于将有多个块,具有相同的类名和所有内容,因此需要一个可伸缩的代码

实际上,您应该将每个块从视图模型中的一个项目中逐出。只需为每个项目添加一个扩展的(布尔)选项。然后,您可以使用
ngClass
将css类从中删除

更多

由于将有多个块,具有相同的类名和所有内容,因此需要一个可伸缩的代码

实际上,您应该将每个块从视图模型中的一个项目中逐出。只需为每个项目添加一个扩展的(布尔)选项。然后,您可以使用
ngClass
将css类从中删除

更多