Skip to content

custom directive 설정할 때, 헷갈린 점 #3

@JoonseokRyu

Description

@JoonseokRyu

자신이 만들려는 이름을 angular.module('exampleDirective', [])에 넣고,

shoppingModule.directive('myDirective', function () {
    return {
        restrict: 'A',
        templateUrl: './shopping.html',
        controller: cc // <- controller  설정
    };
});

처럼 controller를 설정해 주는 부분이 존재한다.

<body ng-controller ="CartController">

에 controller를 설정해 주는 부분이 있다하더라도 작동하지 않는다.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions